Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a user on Windows 7 that is trying to access a local server with a DNS name of windows.cs. We have two internal DNS servers. The DHCP server assigns users the two internal DNS servers as primary and secondary and then our ISPs DNS as a tertiary DNS server.

Every now and then, the user can't access the website at windows.cs. If I ping it, it says it can't resolve the host name. I flush the DNS cache, and then when I display the dns cache it has the following:

windows.cs - Name does not exist

Yet if I use nslookup, which by default queries the primary DNS server (our internal one) and I query windows.cs, it returns the correct IP address.

So why can't Windows resolve the hostname using ping, but it can when using the nslookup tool? And how do I fix this?

share|improve this question
1  
+1, I have this problem often... even with hostnames I was just using 5 minutes ago! –  Brad Jun 21 '11 at 21:58
add comment

2 Answers

up vote 10 down vote accepted

It appears from what you're saying that the request for windows.cs is going to the ISPs DNS server now and again. The nxdomain result is then cached by Windows' DNS client, and thus used for any retries with a web browser, ping etc. Clearing the cache (ipconfig /flushdns) should force the Windows DNS client to retry the query, but there's no guarantee it won't go to the ISP DNS server again.

The reason ping can't resolve the hostname but nslookup can is because nslookup a low-level tool that bypasses the Windows DNS client. It uses whatever DNS server you tell it to (the first one by default), and does the query on the fly. You can change the DNS server it queries by typing server <host> from the nslookup prompt, where host is the IP or FQDN.

The Windows DNS client however will only do queries for entries that are not in its cache (or have expired). Otherwise it returns the cached result.

It's not immediately apparent why the Windows client is using the ISP DNS server. Perhaps it could not resolve the local server recently (due perhaps to being on another network), perhaps the local server was returning errors. Or, perhaps it is not ordered correctly under Advanced TCP/IP settings > DNS.

Personally I prefer to only use local DNS server addresses on workstations (propagated by DHCP), to simplify configuration and avoid issues like this. I'd be curious to know the rationale behind setting the ISPs DNS server on desktops. I can't imagine there being any valid performance reasons, and as far as redundancy goes two is enough on most networks (if not add a third).

share|improve this answer
    
You bring up a good a point. There is no particular reason why we have the DHCP server assigning it as a tertiary. And that seems like a reasonable explanation for why it's not resolving (but why it's going to the 3rd DNS server?? who knows..). Thanks for the direction. I'll remove the public DNS server from the assigned DNS server handed out through DHCP and see if resolves the issue. The internal DNS servers should pass any queries they can't answer to that DNS server anyway, so it shouldn't be an issue. –  Safado Jun 21 '11 at 22:42
    
Update: This seems to have fixed our issue. Thanks for the suggestion! –  Safado Jul 6 '11 at 16:55
add comment

The results of nslookup differ from that of ping because of nslookup idiosyncracies and bugs. They are not really relevant to your main problem, however, which is that you've violated the rule that your fallback proxy DNS servers must provide the same view of the DNS namespace as your principal one. Your ISP's proxy DNS server doesn't provide the same view of the DNS namespace as your own proxy DNS servers on your LAN.

It would seem that yet another system administrator has fallen foul of the My ISP provides and documents it, so I must use it. fallacy. ☺

share|improve this answer
    
So in laymans terms, you're saying don't assign DNS servers to my users unless I know that those DNS servers have the same information? Your links don't work. –  Safado Jun 23 '11 at 22:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.