Fighting DNS resolving in Ubuntu 12.04 (server)

I recently installed a DNS sever using Ubuntu 12.04.  The server should serve only my exernal domain, but should use an internal server for it's own name resolution.

Setting dns-nameservers to the correct ip in /etc/network/interfaces did not work on this host (but does on all my non-dns hosts).

After some digging, I found the cause: resolvconf always reverts to nameserver which in turn queries the hosts in dns-nameservers.  Because my host is already a nameserver, points to my bind instance instead of a caching daemon.

The solution I found was to put my entries in /etc/resolvconf/resolv.conf.d/head, this way they end up on top of the resolv.conf file and the real DNS server gets queried first!


You can also fix this by manipulating /etc/resolvconf/interface-order

Look at /run/resolvconf/interface/ - there should be multiple files in your case. Now assure that the correct entry is referenced above the wrong one in the interface-order file

Yes, I had also these issues, and came up with the same solution.

But honestly, while it's nice to have resolvconf on desktops, or any other device which gets infos via DHCP, it's a pain for servers.

I really don't get it why we should have something like that on servers...

I suppose because you could still have a server with dhcp, like any IAAS offering ( not sure if that's true, but that would be IMHO much simpler than using some template for creating the vm, just clone the disk, and boot with dhcp ).

Good god, I've been pulling out what little hair I have left because of this issue. Thanks for posting the quick fix. My server now successfully lookups up dns from my dd-wrt router (which uses dnsmasq for so-called static DHCP) instead of from itself. All is well in my network once more.