HOSTS file does nothing?

A

Alex Clark

Hi all,

I edited my hosts file recently to block out a couple of ad-server domains
and noticed it didn't do anything. Curious to test whether my hosts file
worked at all, I directed www.google.com to 127.0.0.1 and ran IE. It
promptly loaded www.google.com without any bother at all.

I rebooted and still had the same issue. It seems the HOSTS file is being
totally ignored. I've Googled for information on it but as far as I can
tell, Windows XP still makes use of this file?

I'm on XP Pro 64bit if that makes any difference?

TIA,
Alex
 
B

Bruno

Alex Clark said:
I edited my hosts file recently to block out a couple of ad-server domains
and noticed it didn't do anything. Curious to test whether my hosts file
worked at all, I directed www.google.com to 127.0.0.1 and ran IE. It
promptly loaded www.google.com without any bother at all.

The hosts file in is "\WINDOWS\system32\drivers\etc" and has no extension.
Is it the file you've edited?
 
K

Ken Blake, MVP

The hosts file in is "\WINDOWS\system32\drivers\etc" and has no extension.
Is it the file you've edited?


And, Alex, exactly how did you edit it? Please copy and paste the line
here.
 
J

John Wunderlich

Hi all,

I edited my hosts file recently to block out a couple of ad-server
domains and noticed it didn't do anything. Curious to test
whether my hosts file worked at all, I directed www.google.com to
127.0.0.1 and ran IE. It promptly loaded www.google.com without
any bother at all.

I rebooted and still had the same issue. It seems the HOSTS file
is being totally ignored. I've Googled for information on it but
as far as I can tell, Windows XP still makes use of this file?

I'm on XP Pro 64bit if that makes any difference?

TIA,
Alex

It is doubtful that the Hosts file is being ignored.
To test, try creating a new Hosts entry "abc" and assign it the
numeric IP address of, say, yahoo.com. Then try pinging "abc"...

A couple of things could cause the behavior you describe.

First: Are you accessing the internet through a proxy server? If so,
the proxy server will do the lookups for you.

Second: Browsers are sometimes too smart for their own good. It may
have tried "www.google.com", as specified, and it might have failed
because of your Hosts entry. It then might have automatically tried
"google.com" (which is _not_ the same as far as a Host file is
concerned) which probably did work.

HTH,
John
 
A

Alex Clark

Here are a couple of lines I've added:

127.0.0.1 google.com
127.0.0.1 www.google.com

Pinging either of the above resolves to 127.0.0.1. Surfing via IE takes me
to the Google homepage.
First: Are you accessing the internet through a proxy server? If so,
the proxy server will do the lookups for you.

I think you've just hit upon the problem - I believe my ISP has some sort of
transparent proxy. So they must be doing the lookup work then, rendering my
HOSTS file irrelevant ya reckon? That's a pain, because I could do with
filtering out a few domains.

AHA! Altering the IE connection settings to add a proxy exception for
addresses beginning with *.google.com seems to prevent it loading though!

At least that explains it, but I don't fancy having to add a long list of
blacklisted sites to that tiny little textbox in the IE settings. Sounds
like it may be the only solution though :-(

Thanks for all your help, and that goes to everyone on this thread.
Alex Clark
 
A

AlmostBob

Clear the TIF
cached pages are loaded from the tif


--
Adaware http://www.lavasoft.de
spybot http://www.safer-networking.org
AVG free antivirus http://www.grisoft.com
Etrust/Vet/CA.online Antivirus scan
http://www3.ca.com/securityadvisor/virusinfo/scan.aspx
Panda online AntiVirus scan http://www.pandasoftware.com/ActiveScan/
Catalog of removal tools (1)
http://www.pandasoftware.com/download/utilities/
Catalog of removal tools (2)
http://www3.ca.com/securityadvisor/newsinfo/collateral.aspx?CID=40387
Blocking Unwanted Parasites with a Hosts file
http://mvps.org/winhelp2002/hosts.htm
links provided as a courtesy, read all instructions on the pages before use

Grateful thanks to the authors and webmasters
_
 
J

John Wunderlich

Here are a couple of lines I've added:

127.0.0.1 google.com
127.0.0.1 www.google.com

Pinging either of the above resolves to 127.0.0.1. Surfing via IE
takes me to the Google homepage.


I think you've just hit upon the problem - I believe my ISP has
some sort of transparent proxy. So they must be doing the lookup
work then, rendering my HOSTS file irrelevant ya reckon? That's a
pain, because I could do with filtering out a few domains.

AHA! Altering the IE connection settings to add a proxy exception
for addresses beginning with *.google.com seems to prevent it
loading though!

At least that explains it, but I don't fancy having to add a long
list of blacklisted sites to that tiny little textbox in the IE
settings. Sounds like it may be the only solution though :-(

Thanks for all your help, and that goes to everyone on this
thread. Alex Clark


Thanks for the feedback.
-- John
 
G

Gander

Alex Clark skrev:
I think you've just hit upon the problem - I believe my ISP has some sort of
transparent proxy. So they must be doing the lookup work then, rendering my
HOSTS file irrelevant ya reckon? That's a pain, because I could do with
filtering out a few domains.

A transparent proxy won't interfer with what you are trying to do. Only
a proxy you have entered into the proxy settings in your browser will
bypass your hosts file.
 
D

david

You don't have to enter the proxy settings though. The auto-discover
routine will automatically discover a proxy if the proxy responds
to auto-discovery, and the proxy settings will be filled in from the
auto-discover response.

This is not the same as a transparent proxy, this is just a different
way of filling in the proxy settings on your browser.

(david)
 
D

david

At least that explains it, but I don't fancy having to add a long list of
blacklisted sites to that tiny little textbox in the IE settings. Sounds


You can get an IE settings update from the same people who maintain
hosts files. Have a look around the web to see if that is still true. You
just load the file and all the standard bad sites are blocked by your
browser.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top