Windows 7 - host file not working

Asked By KitRamo on 08-Feb-08 12:15 AM
okay I'm having an odd problem here. I don't have problem getting to
websites, but that is also the problem some websites I'm susposed to have a
problem getting to but I don't.

or putting it another way, here's a test I did
File: c:\windows\system32\drivers\etc\hosts       localhost

after saving the file I did the ipconfig /flushdns
and it said "Successfully flushed the DNS Resolver Cache."
then i issued  nslookup
Non-authoritative answer:

then I tried nslookup localhost
*** can't find localhost: Non-existent domain

I checked my registry next
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath is set to: "%SystemRoot%\System32\drivers\etc"
next I checked the system varables

I then did a netsh and dump, and restarted my computer.
I then tried again to do a nslookup on and again it found the
actual ip address of the website complety ignoring the entry in the hosts
file. then I tried the localhost and again it said it didn't exist.

what is gooing on? and more importnaly how do I fix this?

KitRamo replied on 08-Feb-08 12:35 AM
I just relised something that I did that I didn't mention that will probly
help clarify the problem
I also did a nslookup on as well as when I  I
mentioend i was dooing just one I actualy did bouth just to be through but
forgot to mention it.
bouth times it found the acutal ip not the one listed in the hosts file
-Karl replied on 08-Feb-08 08:30 PM
Not sure if you plan on using the hosts file on multiple PCs but for
me on my PC, I used to use the HOSTS file myself but it's extremely
limited and I ended up using a nice app called AdMuncher.  Try the 30-
Trial.  Im not promoting them but I do have to say they are good and
you can easily customize the list as needed.

If you need to manage multiple PCs, well, I still would recommend some
software util that you can copy the configs to.  I've always liked
Symantec personally but that may not be feasible.

Still you'll end up realizing how limited the HOSTS file is.  Granted
for a simple domain name it'll work but it won't stp scripts / ads /
subpages in a domain you allow

Just my 2 cents
John Wunderlich replied on 08-Feb-08 03:55 PM
=?Utf-8?B?S2l0UmFtb3M=?= <KitRamos@> wrote

Your problem is that you are using the program "nslookup" which is
short for "Name Server Lookup".  This program will *always* do a lookup
on a name server and report the answers given by the name server, which
of course, bypasses the Hosts file.

Try using a command/program like:
and see what the normal name resolution path comes up with...