Problem with the hosts file in Windows XP

I have a computer with Windows XP SP2 with a weird problem. The hosts file doesn't work. No matter what I do, adding or removing entries in the file doesn't make any difference, pinging the added names times out. I tried flushing the DNS cache (using ipconfig /flushdns) but that didn't work, I even tried to restart the DNS client service but that made no difference too.

Removing entries also has no effect, I ping the names and I get a reply.

Help!!!

Edit: Thanks for your answer guys, but the problem is more complicated than this. It seems I'll have to reinstall Windows.


Last time that happened to me, I was letting notepad name the file hosts.txt.

It must be named hosts - no extension. Change notepad save as to ..


Suggestions:

1- Make it is named "hosts." with no extension. As another commenter noted, sometimes editors will try and impose their default extensions.

2- Make sure you are using the file in the correct location. On my XP box it is C:\WINDOWS\system32\drivers\etc

3- Make sure that the entries you are trying to make are properly formatted. In particular, do not prefix the line with a #; that indicates a comment/remark.

Are you sure about the re-install? I am all for it, I do it once or twice a year to clean the fluff, but what makes you think it will solve the issue with (basically) name resolution?

Good luck


please take this Link as a Reference how to handle and setup your hostfile.

http://www.mvps.org/winhelp2002/hostsfaq.htm

Furthermore, take a look into your Windows Event Log if any error is thrown.

Good Luck,
rAyt