Ubuntu resolv.conf, not going to next nameserver

domain-name-systemnetworkmanagerresolv.confUbuntuubuntu-10.04

I am using Ubuntu 10.04 Desktop, which comes by default with the "Network Manager" (which I am highly suspicious of).
I am having an issue with resolving DNS zones on 2 different nameservers.

resolv.conf:

$ cat /etc/resolv.conf
#Generated by Network Manager
search example.org
nameserver 10.0.0.20 #public nameserver, contains public.example.org
nameserver 10.0.0.30 #private nameserver, contains private.example.org

And the problem. Whichever name server is listed first will resolve :

$ ping host.public.example.org
PING host.public.example.org (10.0.0.50) 56(84) bytes of data.

The one listed second will not:

$ ping host.private.example.org
ping: unknown host host.private.example.org

But it IS there:

$ dig @10.0.0.30 host.private.example.org
...
;; ANSWER SECTION:
host.private.example.org.   3600    IN  A   10.0.0.60
...

If I reverse the order of nameservers in /etc/resolv.conf, host.private will then be accessible and host.public will not. Why? From resolv.conf man page:

If there are multiple servers, the resolver library queries them in the order listed.

It isn't just ping that has problems, I noticed this when Thunderbird couldn't get mail because the mail server's DNS record is in the 2nd server listed. Shouldn't what I'm trying to do here work?

Best Answer

Ahhhh....it doesn't really work that way. As long as the first nameserver is running and active all bind requests will go to it. The only way that you get to the second nameserver is if the previous nameserver in the list has died and after a LONG timeout.

To fix your problem, I'm guessing that you might have to build a local caching DNS server configuration and direct the nameservers for the two zones to the two different servers. Your resolver configuration would be then set to use the IP of the host.