1

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
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 192.168.1.1

Can someone please help me fix this!

1
  • 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
0

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 127.0.0.1 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.

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

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
  • 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.