OK, I feel the need to weigh in again; please let me know if I'm off base here.
Let's take a small network I can think of as an example. There is a single server on the LAN, which provides DNS services. Let's say it's a Windows Domain Controller (DC), for the sake of argument. This DC provides DNS resolution for a Windows Active Directory domain, so clients on the LAN can resolve local services and hosts using DNS. The DNS zone for the LAN AD might be
ad.internal.
The DC is also set up to forward queries to an ISP's DNS server. This means that in the event that a client queries for www.google.com (which is not in the
ad.internal zone for which the DC is authoritative), the DC forwards the query to the ISP and gets it resolved there. The DC then caches this reply and passes the response back to the client. All is good.
In such an environment, it would also be common practice to set the DHCP service to provide the ISP's DNS server as a second DNS server to all clients. That way, if the DC fails, clients can still resolve internet hosts as when they can't contact the first DNS server (the DC), they'll try the second (the ISP). However, the ISP knows nothing about the
ad.internal zone, and never will.
This type of setup is common, and works well for all clients that aren't running Snow Leopard. This includes many Linux distributions, OS X 10.4 and 10.5 and all versions of Windows that I have tested. Snow Leopard is the only DNS client that
doesn't work properly in this scenario. Several posts here support this.
My experience is that Snow Leopard fails to correctly use the LAN DNS server, even when the LAN server is fine, and so local, LAN- based (
ad.internal) hosts and services are not resolved. Performing a dig against the LAN server for internal
and external hosts shows that
both resolve fine, even when telnet, http and other access to LAN hosts is failing through name resolution.
This is a bug in Snow Leopard, whichever way you slice it. I do not believe that the notions that all DNS servers should return the same results or that internal and external DNS servers should not be mixed are correct as without discussing the intricacies of DNS, the simple fact is that this type of configuration is employed by many, many networks and has historically worked fine, even with Leopard. Furthermore, they still work fine for Tiger, Leopard, Windows and Linux DNS clients. It's just Snow Leopard that has problems.
There's been some interesting technical discussion around dig, scutil, dscacheutil and so forth, which has been enlightening to a point, but it should be remembered that dig returns good results even when other processes can't resolve a host. My take on all this is therefore that the internal workings of name resolution on Snow Leopard are different from what we've seen before and possibly broken. The fact that dig resolves a host is no indication that the system will resolve it. Running scutil to determine current DNS service order and then using dig against the first server is therefore flawed - I know from experience that dig will return good results even though other services or applications are failing to resolve that host/FQDN. William Kucharski's last post backs this up.
To demonstrate, I have reproduced the erroneous behaviour on a system here and run *scutil --dns* to see what the current DNS configuration is and I get the following as the first stanza of the output:
resolver #1
search domain[0] : ad.internal
nameserver[0] : 192.168.0.10
nameserver[1] : 192.168.0.254
order : 200000
In the above, 192.168.0.10 is the DC (the internal LAN DNS server for ad.internal) and 192.168.0.254 is the firewall which also acts as a caching-only DNS server. If I dig local
or internet hosts @192.168.0.10, I get good results. As an example, I might *dig @192.168.0.10 dc.ad.internal* and get the correct response (note that nslookup also works as expected, giving the correct response). However, if I *ping dc.ad.internal* I get "+ping: cannot resolve dc.ad.internal: Unknown host+". The system is therefore not resolving names the way I would expect.
The workaround, until Apple fix or explain this behaviour is to only specify the internal DNS server(s) to DNS clients, so that they will never try a DNS server that can't resolve internal hosts. If I remove 192.168.0.254 as a DNS server so that only 192.168.0.10 is specified, the problem goes away. The problem is that clients will no longer resolve internet hosts if the internal DNS server fails.
Hope that helps! - if anyone works this out, please post back.