# Hosts file not working - help?



## Dejitaru_Davis (Apr 4, 2007)

Alright, I'm not sure if this is exactly the place I should post this...but here it goes.

My hosts file won't work. Sites listed in it won't be checked as written; it's like the PC won't recognize it, or ignores it, and skips straight to the DNS. I've never actually used it before, but now that I want to and I can't get it to work it frustrates me!

I'm not sure exactly what you would need to know to begin diagnosing a problem...but I can take a blind stab at it.

- No, it's not a .txt file, it doesn't have an extension. Yes, it's all formated correctly, I've already been over that with people.
- I'm running XP SP1, if it matters.

I can do anything else/get any information you guys need...just could someone please help me get this working? Thanks.


----------



## Squashman (Apr 4, 2003)

Dejitaru_Davis said:


> - No, it's not a .txt file, it doesn't have an extension. Yes, it's all formated correctly, I've already been over that with people.
> - I'm running XP SP1, if it matters..


Well, I try to give everyone the benefit of the doubt as well, but it never hurts to post the same information again.

Have you tried downloading one of the several hosts files available on the internet to see if those work. There is an MVP one that comes to mind.


----------



## Squashman (Apr 4, 2003)

One more thing.... since you have gone thru this problem with several other people, could you please post what you have tried so far so that we don't waste your time with posting things that may not fix your problem.

Just google searching comes up with all kinds of solutions.


----------



## Dejitaru_Davis (Apr 4, 2007)

Yeah, I've tired a couple 'premade' host files without success...the sites that should be blocked come up anyway.


----------



## Dejitaru_Davis (Apr 4, 2007)

And sure, though I haven't been through that much.

- I edited the right file. c:\windows\system32\drivers\etc\hosts
- It's not a text file, or any other extension. It's also the right file, not the backup or anything.
- Formatting should be right. As I said, I've tried some premade ones.
- Flushed the DNS.
- Rebooted.

I've kinda wondered if it's a proxy problem? From what I understand, running off a proxy overrides any hostnames your PC has saved locally and skips straight to the DNS (normally the hosts file is checked before the DNS?) I don't think I'm on a proxy, though -- I never set up any proxy settings in IE, but if there's some way to _check_ if I'm on a proxy that I don't know about, I'd love to hear it. I'm connected through a dormroom internet connection, so I suppose it's possible.

I'd prefer leave the diagnosis up to the guys who actually know about this sort of thing, though. :/


----------



## Squashman (Apr 4, 2003)

Read over a few of these links if you haven't already.
http://hardware.mcse.ms/archive92-2005-9-237021.html
http://www.bleepingcomputer.com/tutorials/tutorial52.html


----------



## TerryNet (Mar 23, 2005)

Why not post at least a few of the relevant lines in your hosts file?


----------



## hewee (Oct 26, 2001)

Did you make your own hosts file and did it every work?
Do you have a hosts manager?
Do you have a hosts manager or any other program that disables a hosts file?


----------



## dwm1225 (Aug 23, 2007)

Okay, so I've searched high and low and haven't been able to find a resolution, so I'm hoping I can get help here.

In a nutshell, I am having the same problem here with my hosts file.

I am runing Windows XP sp2.
I connect to a dlink DI-614+ router using DHCP.

I have the following lines in my hosts file:

127.0.0.1 localhost
205.212.166.186 testing.com

If I attempt to view testing.com in my browser (firefox 2 and IE6), the domain resolves to 69.59.195.14. However, if I ping the domain from a command prompt, it resolves like it's supposed to:



> >ping testing.com
> 
> Pinging testing.com [205.212.166.186] with 32 bytes of data:
> 
> ...


However, if I run an nslookup it resolves to the actual IP address for testing.com



> >nslookup testing.com
> *** Can't find server name for address 192.192.0.1: No response from server
> *** Default servers are not available
> Server: UnKnown
> ...


What's really strange is at work with my laptop with these exact settings in my hosts file, everything works. But when I bring it home and connect to my dlink router, the hosts file is suddenly ignored. Just a note, I connect via DHCP at work as well.

Anyone have any ideas? It seems like my router/network setup is overriding my hosts file. Stranger still is that ping will result in the correct IP address, yet my browsers don't and neither does nslookup? What am I missing?

Thanks!


----------



## dwm1225 (Aug 23, 2007)

Here's an update.

If I browse to a domain setup in my hosts file, it doesn't work. However, if I go to the same domain using https, the hosts file is read I'm directed to the correct URL. 

Any ideas?


----------

