Ubuntu – DNS sometimes works, but it is very slow.

12.04dnsdnsmasqnetworking

I am having DNS problems since upgrading to Ubuntu 12.04 (Precise Pangolin) from Ubuntu 10.04 (Lucid Lynx) yesterday.

DNS sometimes works, but it is very slow.

I have read the blog post DNS in Ubuntu 12.04.

  • "I really don’t want a local resolver, how can I turn it off?
    To turn off dnsmasq in Network Manager, you need to edit
    /etc/NetworkManager/NetworkManager.conf and comment the “dns=dnsmasq”
    line (put a # in front of it) then do a “sudo restart network-manager”."

I do not have this line to comment. Checking in Synaptic Package Manager reveals that dnsmasq isn't installed (dnsmasq-base is).

Editing and creating connections using the NetworkManager GUI (and specifying DNS servers) doesn't help; Ubuntu is not respecting user GUI set DNS servers. Should these GUI tools not work?

  • "I use a static IP address configuration, where should I put my DNS configuration?
    The DNS configuration for a static interface should go as
    “dns-nameservers”, “dns->search” and “dns-domain” entries added to the
    interface in /etc/network/interfaces"

Are any examples of this available? My /etc/network/interfaces is extremely sparse.

For now, I have edited /etc/resolv.conf replacing nameserver 127.0.0.1 with that of my DNS server (my broadband router), but I don't know how long this fix will last before the file is overwritten by this new system (dnsmasq?).

Best Answer

network-manager is meant to manage your whole workstation's networking requirements in 12.04 along with resolvconf and dnsmasq-base.

dnsmasq-base is just the executable dnsmasq file which network-manager runs using a separate config and no start-up scripts.

resolvconf rewrites /etc/resolv.conf whenever one of the 12.04 integrated packages tells it via scripts that something has changed.

It doesn't sound like it's correctly installed if you don't have that dns=dnsmasq line in your config. It might also account for the slowness.

You could try dpkg-reconfigure on network-manager and on resolvconf

Alternatively if you are using programs like VPNs that are not integrated with network-manager or other non-compatible programs, you could de-install network-manager and resolvconf completely and rely on isc-dhcp-client to set up your network and DNS, or pppd if you're using a modem.

dnsmasq under control of network-manager is intended to speed up DNS look-ups through caching, but if you de-install network-manager, then you'll also get rid of dnsmasq - at least it won't run on its own. You need the regular dnsmasq package to get it starting up and running at boot time.

You don't say if you need DHCP or you have static IP addresses.

Related Question