Discussion:
etc\hosts file is ignored selectively
(too old to reply)
Alvaro G. Vicario
2003-09-11 10:20:39 UTC
Permalink
I've found out a problem I've never had before. I use
C:\WINDOWS\system32\drivers\etc\hosts file when I need to test a name based
website hosting before changing the domain DNS records. That way I make my
computer believe the site IP is the one I want so I can browse the site with
Explorer and check whether everything is fine.

However, I've just realized it has stopped working. And it's pretty curious
because Windows uses hosts file for loopback addresses (like 127.0.0.1) and
for LAN addresses (like 192.168.0.1) but not for Internet public addresses
(like 216.239.57.99). That makes me thing of:

a) A misconfiguration (where??)
b) A Windows Update patch + Microsoft's weird idea of network security

Any idea of what might be happening?
allan grossman [ms-mvp]
2003-09-11 11:38:33 UTC
Permalink
Hi, Alvaro -

I use a hosts file on my machine to help filter out
spyware and stuff - by redirecting domains like
doubleclick.net to the loopback adapter and it works just
fine. I also redirect requests for the domain name I own
back to the private network where it's located
(192.168.x.x) for performance reasons. Before I
relocated that domain and changed the DNS records for it
I used a hosts file to make sure everything worked.

This leads me to believe the hosts file works just fine -
can you be a little more specific about what the problem
is? The only other things I can think of are a syntax
error in the hosts file (pretty hard to do) or that the
redirection is pointing to a network address that can't e
routed to.

hth -
-----Original Message-----
I've found out a problem I've never had before. I use
C:\WINDOWS\system32\drivers\etc\hosts file when I need
to test a name based
website hosting before changing the domain DNS records.
That way I make my
computer believe the site IP is the one I want so I can
browse the site with
Explorer and check whether everything is fine.
However, I've just realized it has stopped working. And
it's pretty curious
because Windows uses hosts file for loopback addresses
(like 127.0.0.1) and
for LAN addresses (like 192.168.0.1) but not for
Internet public addresses
a) A misconfiguration (where??)
b) A Windows Update patch + Microsoft's weird idea of
network security
Any idea of what might be happening?
.
Alvaro G. Vicario
2003-09-12 09:47:18 UTC
Permalink
Post by allan grossman [ms-mvp]
I use a hosts file on my machine to help filter out
spyware and stuff - by redirecting domains like
doubleclick.net to the loopback adapter and it works just
fine. I also redirect requests for the domain name I own
back to the private network where it's located
(192.168.x.x) for performance reasons.
What I mean is that I can redirect www.google.com to 127.0.0.1 (loopback)
and to 192.168.0.0.1 (LAN) but when I redirect to 216.109.118.66 (Internet,
actually Yahoo's IP) the entry is simply ignored. Google is just a mere
example, it happens with whatever domain name I've tried.

I type "ipconfig /flushdns" and restart browser every time. It could be a
syntax error but my hosts file is basically empty:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Éste es un ejemplo de archivo HOSTS usado por Microsoft TCP/IP para
Windows.
#
# Este archivo contiene las asignaciones de las direcciones IP a los nombres
de
# host. Cada entrada debe permanecer en una línea individual. La dirección
IP
# debe ponerse en la primera columna, seguida del nombre de host
correspondiente.
# La dirección IP y el nombre de host deben separarse con al menos un
espacio.
#
#
# También pueden insertarse comentarios (como éste) en líneas individuales
# o a continuación del nombre de equipo indicándolos con el símbolo "#"
#
# Por ejemplo:
#
# 102.54.94.97 rhino.acme.com # servidor origen
# 38.25.63.10 x.acme.com # host cliente x
127.0.0.1 localhost
216.109.118.66 www.google.com

Please note that typing 216.109.118.66 in your browser opens Yahoo site so
IP is perfectly routable. I'd greatly appreciate that you tried it
yourselves in your computers and tell me whether it works. Thanks before
hand.
Alun Jones [MS MVP]
2003-09-12 17:55:57 UTC
Permalink
Post by Alvaro G. Vicario
What I mean is that I can redirect www.google.com to 127.0.0.1 (loopback)
and to 192.168.0.0.1 (LAN) but when I redirect to 216.109.118.66 (Internet,
actually Yahoo's IP) the entry is simply ignored. Google is just a mere
example, it happens with whatever domain name I've tried.
I suspect (though I haven't tried) that Yahoo's web site is telling you
"www.google.com/index.html isn't known here, but you can find it at ..." and
giving an IP address.

Monitor the network transmission, but I'll bet that's what's going on here.
You could also run "netstat" to see what address your IE session is
connected to, if you like.

Alun.
~~~~

[Please don't email posters, if a Usenet response is appropriate.]
--
Texas Imperial Software | Find us at http://www.wftpd.com or email
1602 Harvest Moon Place | ***@texis.com.
Cedar Park TX 78613-1419 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(512)258-9858 | Try our NEW client software, WFTPD Explorer.
Marc Reynolds [MSFT]
2003-09-11 13:00:45 UTC
Permalink
Hi,

A couple of possibilities:

1. You incorrectly entered the records into the Hosts file.
2. You already have a record for the host you are trying to use cached by
the DNS client services. You can flush the DNS client cache by running
"ipconfig /flushdns" at the command line.

Thanks,
Marc Reynolds
Microsoft Technical Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...