1

Oh, Hello!

Tried to fix name resolution on my Ubuntu 12.04 LTS box using answers read here... no effect at all:

  1. Tried to move /etc/resolv.conf link away
  2. Tried to change hosts order in /etc/nsswitch.conf
  3. Tried to reboot|remove|reconfigure my LinkSys, which is a DHCP server for my network

No results. For now, I'm using "reload button" method 'till desired site is open, though if I've misspelled its FQDN.

Can anyone advise something else?

1
  • I don't fully understand. You can get sites to load by hitting "Reload"? Then name resolution must work. Can you ping sites by domain name from a terminal, e.g., ping www.google.com? If so then name service is not the problem.
    – jdthood
    Nov 5, 2012 at 10:49

2 Answers 2

5

Assuming it's true that name service doesn't work, here is a generic procedure which fixes a couple of known bugs.

Is resolvconf installed? If so then do the following.

sudo dpkg-reconfigure resolvconf

If it is not installed then do the following.

sudo apt-get install resolvconf

Now that resolvconf is installed correctly, reboot so that resolvconf will be provided with nameserver information.

If name service is still broken and you are using NetworkManager to manage networking then open /etc/NetworkManager/NetworkManager.conf in an editor and comment out the line "dns=dnsmasq". To comment it out, put a '#' character at the beginning of the line.

gksudo gedit /etc/NetworkManager/NetworkManager.conf

Next go into the connection editor and make sure that the connection you are using is properly configured. E.g., most often "network indicator | Edit Connections... | Wired | Wired connection 1 | Edit... | IPv4 Settings | Method" is set to "Automatic (DHCP)" and no "Additional DNS server" addresses are set.

Then restart network-manager.

sudo restart network-manager

Now confirm that the expected nameserver address(es) appear in /etc/resolv.conf.

If you aren't using NetworkManager to configure interfaces and you are using ifup then edit /etc/network/interfaces and include dns-nameservers and dns-search lines in the appropriate iface stanza as needed. Make sure that /etc/resolvconf/resolv.conf.d/head only contains comment lines and that /etc/resolvconf/resolv.conf.d/base and /etc/resolvconf/resolv.conf.d/tail are absent or empty. Then ifdown and ifup the interface. Confirm that the nameserver address(es) that you added to /etc/network/interfaces now appear in /etc/resolv.conf.

If name service still does not work then there's most likely a local problem: a misconfigured DHCP server, for example. Another known cause of problems is third-party VPN clients which trash the symbolic link /etc/resolv.conf. If your LAN seems OK and you aren't using third-party networking software then file a bug report against NetworkManager or resolvconf, whichever you think is more likely the culprit.

1
  • This answer worked perfectly for me. dnsmasq just randomly stopped working but commenting it out in NetworkManager.conf and restarting the network-manager service sorted it. Thanks! :)
    – mkgrunder
    Feb 13, 2014 at 16:50
0

I have the same problem... and I tried both with dnamasq and without it.

  • When using dnsmasq for DNS it is getting started by network-manager, /etc/resolv.conf is pointing to localhost, but dnsmasq is unable to resolv any DNS names.

My network is configured in such a way that I can only exit through a HTTP proxy and the tricky part is that it is set with proxy.pac so for getting the proxy configuration I also need the DNS to work...

dnsmasq should not try to connect directly to the DNS root servers(which it looks like it does), but it should just use the DNS servers available from within my network that I get through DHCP. But there is nothing telling it to use them, since both /var/run/nm-dns-dnsmasq.conf and /etc/NetworkManager/dnsmasq.d are empty.

  • When not using dnsmasq for DNS in network-manager, I get the right DNS servers set inside /run/resolvconf/interface/NetworkManager, but resolvconf just won't use them, since it keeps getting localhost from /run/resolvconf/interface/lo.dnsmasq. The problem goes away after removing this file and restarting resolvconf.

I think the problem can be worked around in two ways:

  • If using dnsmasq, you should configure your name servers in /etc/NetworkManager/dnsmasq.d
  • If using just resolvconf, the removal of /run/resolvconf/interface/lo.dnsmasq and restart of resolvconf should do the trick.

Still, NetworkManager should be fixed in order to solve this problem properly...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .