Windows – Hosts File not working correctly

I’m having some issues with my hosts file.

127.0.0.1 localhost127.0.0.1 whatever127.0.0.1 sub.localhost127.0.0.1 example.com

localhost and whatever both work. However the others have weird behaviour.

Ping sub.localhost

c:>ping sub.localhostPinging sub.localhost [127.0.0.1] with 32 bytes of data:

Ping example.com

C:>ping example.comPinging 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 Settingsamatos>ping example.comPinging example.com [127.0.0.1] with 32 bytes of data:C:Documents and Settingsamatos>ping www.example.comPinging www.example.com [127.0.0.1] with 32 bytes of data:C:Documents and Settingsamatos>nslookup example.comServer:   ac1.-------.pt  (# suppose this is the router address...)Address:  192.168.202.2Non-authoritative answer:Name:    example.comAddress:  192.0.32.10

Thanks to all that have tried to help so far!

Solution:

Is your Web browser using a proxy?

Mine is (I am at work) and when I connect to a Web site it seems to use the address the proxy server thinks, not the address my computer thinks.

💠

🔵 Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly — don't miss Amazon's lowest storage prices.

Top 10 Bestsellers
🏆 4.7★+ Reviews
📦 Prime Shipping
👉 See today's best-selling Data storage on Amazon.com HDD · USB Flash Drives · SSD · External Drives
🛒
✅ Updated hourly — Amazon real-time ranking 🔥 Limited stock deals 🔗 Affiliate
⭐ Click to see complete best-selling list ⭐
Scroll to Top