Caleb Lyness wrote:
> 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/its...etwork/deploy/
> depovg/tcpip2k.mspx
> http://www.microsoft.com/technet/its...etwork/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?
I love the detail you have provided here. You did better research than
I did. I gave up with my Windows XP HOME / SP2 because I could not
verify the accuracy of the explanation as above. Indeed, I cam to a
strange, unverified conclusion...
There is hook, perhaps because of a Microsoft business relationship with
some advertisers. There are DNS entries that I can never get rid of. I
will list them at the end of this post. I also find that Windows XP
systems located in different cities may produce different results.
Even thought I have filtered these domains in my HOSTS file, they still
function. Hmmmm. Is there a business agreement involved here?
I have a 250K HOSTS file. I redirect to my own web server to handle
those domains appropriately (Kill their intended function). Why is my
hosts file not in the list created by
ipconfig /displaydns ?
Likewise, I cant flush it.
Where did this unwanted data come from?
Why is it permanent?
Is it perhaps hard coded or otherwise provided by the DNS client service?
.... Ask Bill G.
(If I stop service DNS Client,
ipconfig /displaydns produces message
"Windows IP Configuration
Could not display the DNS Resolver Cache."
Maybe XP Home is different? I doubt it.
HOSTS file IS working; it simply does not show in the DNS cache.
king-daddy
ipconfig /displaydns
Results...
ads.x10.com
----------------------------------------
Record Name . . . . . : ads.x10.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
www15.ad.tomshardware.com
----------------------------------------
Record Name . . . . . : www15.ad.tomshardware.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
rd.advertising.com
----------------------------------------
Record Name . . . . . : rd.advertising.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
us-nj-2.ns.nsatc.net
----------------------------------------
Record Name . . . . . : us-nj-2.ns.nsatc.net
Record Type . . . . . : 1
Time To Live . . . . : 1918
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 67.29.176.241
clickit.go2net.com
----------------------------------------
Record Name . . . . . : clickit.go2net.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
187.188.69.207.in-addr.arpa
----------------------------------------
Record Name . . . . . : 187.188.69.207.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : ns3.mindspring.com
f.abz.com
----------------------------------------
Record Name . . . . . : f.abz.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
ads.pennyweb.com
----------------------------------------
Record Name . . . . . : ads.pennyweb.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
www.clicksites.net
----------------------------------------
Record Name . . . . . :
www.clicksites.net
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
www.paypopup.com
----------------------------------------
Record Name . . . . . :
www.paypopup.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
www.ourmagicbox.com
----------------------------------------
Record Name . . . . . :
www.ourmagicbox.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 24.136.140.88
servedby.advertising.com
----------------------------------------
Record Name . . . . . : servedby.advertising.com
Record Type . . . . . : 1
Time To Live . . . . : 398002
Data Length . . . . . : 4
Section . . . . . . . : Answer
Here is the result