DNS cache and hosts file ignored



Hello everyone,

I have a nice new installation of Window XP Pro 64. SP 1 (v2003).
My problem can be stated rather simply as: My hosts file is being completely
ignored by the DNS client.

The Hosts file is valid (name and content) and located in the correct
folders. The registery settings are correctly set to find the hosts file. I
have read the tech manuels on Microsofts web site looking for any hidden
gotchas. Nothing strange there, and indeed they reflect my understand of how
my domain names should be resolved

Here are some links to the resource I have been using

http://www.microsoft.com/technet/itsolutions/network/deploy/
depovg/tcpip2k.mspx
http://www.microsoft.com/technet/itsolutions/network/evaluat
e/technol/tcpipfund/tcpipfund_ch07.mspx

Right, so now I will draw your attention to the following text from the
above resource (give or take some typos):

This file maps host names to IP addresses. For TCP/IP for Windows XP and
Windows Server 2003, the contents of the Hosts file are loaded into the DNS
client resolver cache.

And then then a little further down some comments about the dns client
resolver are made, which I have summerised/hacked out as follows:

The DNS Client Resolver Cache

The DNS client resolver cache stores entries for both successful and
unsuccessful DNS name resolutions.

* The contents of the cache are built dynamically from the Hosts file
and from DNS queries.
* DNS query entries are kept only for the Time to Live (TTL) period.
* Hosts file entries do not have a TTL and are kept until the entry is
removed from the Hosts file.

The ipconfig /displaydns command can be used to view the contents of the DNS
client resolver cache and ipconfig /flushdns flushes the cache and refreshes
the DNS client resolver cache with just the entries in the Hosts file.

The documenation is quite clear. I flushed the cache and then listed the
contents on the 64 bit PC. The cache was empty. I did the same thing on
another machine, and their the cache contained the hosts file, as promised.

After some more googling I came across a wikipedia entry which stated the
following (give or take a few edits):

Windows XP SP2, and perhaps other versions, appears to ignore the hosts file
if the "DNS Client" service is running. One workaround is to stop the DNS
Cache service. To preserve this setting across reboots ensure that the
service is reconfigured to start manually. (Being a good sport, I added some
text to the entry)

The strange thing is that the 2nd machine I tested on, is an XP SP2
installation... Further, when I turn off this service as suggested, my hosts
file works as expected.

So the question is what is going on here? Is this a bug? Or am I missing
some magic settings that will make dns caching read the hosts file as
promissed in the docs?

When I searched the forum for similar topics I read that some one had the
reverse problem. i.e. when the cache was turned off resolving failed. Which
make sense to me... go figure.

Any ideas?
.



Relevant Pages

  • Re: PC can no longer send email - no response from SMTP server
    ... server using telnet I get a sign-on message from the server whereas ... have you checked the DNS ... To the best of my knowledge and the customer's knowledge, there isn't a firewall - it's W2K rather than Win XP so there wouldn't be the Windows one. ... I'll check the hosts file. ...
    (uk.comp.misc)
  • Re: DNS cache and hosts file ignored
    ... The IP address shown by all these entries is almost surely your ISP's DNS ... The Hosts file is valid and located in the correct ... DNS client resolver cache. ... The DNS Client Resolver Cache ...
    (microsoft.public.windowsxp.network_web)
  • Re: Hosts file ignored
    ... > any of the entries I have made to the server's hosts file. ... > Successfully flushed the DNS Resolver Cache. ... > I am not running a DNS server on my system. ... > I can ping IP addresses without any problem, both on the LAN and on ...
    (microsoft.public.windows.server.general)
  • Re: DNS cache and hosts file ignored
    ... On occassion I've had DNS resolution fail ... Quoting my nice shiny new "Microsoft Windows Server 2003 TCP/IP ... does not ignore the hosts file, but the resolver may not be able to read it! ... At least they are reporting it, though a read only option would be ...
    (microsoft.public.windowsxp.network_web)
  • Re: PC can no longer send email - no response from SMTP server
    ... server using telnet I get a sign-on message from the server whereas ... have you checked the DNS ... firewall - it's W2K rather than Win XP so there wouldn't be the Windows one. ... I'll check the hosts file. ...
    (uk.comp.misc)