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.
Try opening a command line (cmd.exe) and do ipconfig /flushdns and then restart the browser.
Also, I just got to ask since it might be too obvious or sound too stupid. Have you tried rebooting (or at least logged out and then logged in)? I never cease being amazed at what problems this can solve.
UPDATE: Removing Proxy Configuration from browser solved it for sub.localhost. example.com however still not working…
Are you trying to visit http://www.example.com instead of example.com? There is a difference between both!
You should add http://www.example.com to the hosts file too if you want them both to forward to 127.0.0.1.
You said example.com opens 126.96.36.199 – it should go to 127.0.0.1, so either you wrote wrong or the hosts file is not being applied correctly.
I am not sure about the example.com issue, but for the others, I would say that if ping is working, they are working fine, so simply double check that the webserver you are using has the host headers (or whatever setting on your server) set up correctly.
Unsure why this is happening, First thing I would try is a different browser such as Firefox as this has it’s own network settings which should not be affected by other system settings. If this solves it, then go back to IE and on the last tab (
Reset to remove anything else that may be setting this.
next, you can try tweaking your priorities of what is checked.
Open up the
Registry Editor and navigate to :
HostPriority and make sure it is a lower number than
DNSPriority. You can also change it to a lower number such as 5 to make sure it takes priority over everything else.
If it still is not working, I would just say to check things such as your spelling, but it is hard without seeing the machine in person.
Flush your ARP cache:
- Open a cmd window.
arp -awill show all of your ARP entries.
arp -dwill delete the entries (or a specific one).
I would also flush the DNS entries:
ipconfig /flushdns arp -d ping <whatever>