4
1
I'm having some issues with my hosts file.
127.0.0.1 localhost
127.0.0.1 whatever
127.0.0.1 sub.localhost
127.0.0.1 example.com
localhost
and whatever
both work. However the others have weird behaviour.
Ping sub.localhost
c:\>ping sub.localhost
Pinging sub.localhost [127.0.0.1] with 32 bytes of data:
Ping example.com
C:\>ping example.com
Pinging example.com [127.0.0.1] with 32 bytes of data:
All seems ok, but browsing example.com will open the correct example.com page @ 192.0.32.10 which is not the expected behaviour... (obviously sub.localhost wont work at all)
Any ideas why this happens?
UPDATE 1:
Removing Proxy Configuration from browser solved it for sub.localhost
. example.com
however still not working...
UPDATE 2: Some more info...
C:\Documents and Settings\amatos>ping example.com
Pinging example.com [127.0.0.1] with 32 bytes of data:
C:\Documents and Settings\amatos>ping www.example.com
Pinging www.example.com [127.0.0.1] with 32 bytes of data:
C:\Documents and Settings\amatos>nslookup example.com
Server: ac1.-------.pt (# suppose this is the router address...)
Address: 192.168.202.2
Non-authoritative answer:
Name: example.com
Address: 192.0.32.10
Thanks to all that have tried to help so far!
1What version of Windows are you on? – Hello71 – 2010-08-12T15:53:04.070
hosts has 127.0.0.1 example.com and you say "browsing example.com, will open the correct example.com page @ 192.0.32.10 ", this doesn't sound right to me. – bryan – 2010-08-12T16:03:36.203
Windows XP; @bryan, what exaclty doesn't sound right? – acm – 2010-08-12T16:05:55.560
@acmatos: I'm with Bryan - you appear to want example.com to go to 127.0.0.1, yet you also say that when it goes to 192.0.32.10, that is 'correct'. Which do you actually want? – boot13 – 2010-08-12T16:31:45.633
192.0.32.10 is the correct IP of example.com. By "correct" he means "registered in the normal DNS hierarchy". – Andrew J. Brehm – 2010-08-12T16:36:25.113
I mean that if I browse example.com, it will open the same page that you see when you browse example.com. That's the correct page. The correct behaviour however, should be opening 127.0.0.1 (since its defined in hosts to behave like that). I hope I made it clearer this time. :-/ – acm – 2010-08-12T16:38:14.910
Yes, if you browse example.com, it will open the page that you see when you browse example.com. That's a tautology. However, I know what you're trying to say. – boot13 – 2010-08-12T17:54:37.877
boot13: that's not what I said. "(...) if I browse example.com, it will open the same page that you see (...)". I know it's not perfectly explained, however I'm doing my best... – acm – 2010-08-13T08:12:45.873
@acmatos: Got it. I couldn't hear the emphasis on I and you until you added it. Text communication can be tricky. – boot13 – 2010-08-13T13:46:19.267