I was tinkering with my resolv.conf file. I logged in to root and made the changes to it there. All of a sudden, I cannot get through to any websites using my Firefox browser.

The file looks like this

#Generated by NetworkManager

Can someone please help me fix this!

  • If you broke the resolv.conf file, issuing a service NetworkManager restart should fix the problem. NetworkManager generates the resolv.conf if you have NM installed, which is what it looks like to me. – sparticvs Dec 13 '13 at 21:32

Applications read /etc/resolv.conf when they start. If you've changed that file, you may need to restart applications that access the network. Restart Firefox.

To avoid this inconvenience, you can run a local DNS caching proxy, put nameserver in your /etc/resolv.conf to point applications at your proxy, and configure your proxy however you like. This has the added benefit of making DNS requests faster. Dnsmasq is a popular choice. See No DNS on Debian wifi after unplugging the DNS cable and Process calling getaddrinfo() at boot gets permanently stuck with bad /etc/resolv.conf? for examples.

  • Thanks. Your solution worked. I changed my resolv.conf to point to and getting dnsmasq to point to a custom nameserver file fixed the problem. – zam Dec 17 '13 at 15:16

Rebooting would be the simplest way to have the resolv.conf file automatically fixed.

As a couple of comments rightly state, there are definitely more subtle ways to have the file reconstructed, however, they are distribution dependent:

You might check which one match yours, if any:

service network-manager restart      # Debian/Ubuntu/Mint
/etc/init.d/network restart          # Suse
/sbin/service NetworkManager restart # RedHat/Fedora
/etc/rc.d/rc.inet1 restart           # Slackware
  • 2
    I would say that even restarting the network interface in question ought to clear things up. – Joseph R. Dec 13 '13 at 21:28
  • That is indeed the side effect of rebooting I was suggesting under the lines. The idea is people are much more likely to know how to reboot than how to restart an interface. – jlliagre Dec 13 '13 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.