For some time now, each time I typed localhost on Firefox it tried to open www.localhost.com, but accessing 127.0.0.1 worked just fine.
I was lazy about fixing it, but today I got pissed off and decided to find out what the hell was happening.
After googling a little bit I found this forum post: http://www.wilderssecurity.com/archive/index.php/t-198020.html
It happens because of Firefox and Vista's IPv6 support. I'm not sure why it happens, but there are 3 easy solutions:
- Remove the IPv6 entry for localhost in the windows hosts file (explained bellow).
- Disable Firefox's IPv6 support.
- Disable Vista's IPv6 support.
As I don't use IPv6 at all, my choice, is the quickest and dirtiest one: remove the entry from the hosts file.
To do it, just do the following:
- Open notepad as Administrator and edit the file: C:\Windows\System32\drivers\etc\hosts
- Remove the line: ::1 localhost
- Save the file.
- Open up the command prompt as Administrator (hit the windows key, type cmd and then hit Ctrl + Shift + Enter)
- Execute the command: ipconfig /flushdns
- That's all folks :)
I don't know why Firefox tries to open www.localhost.com, but if you are asking yourself what is "::1 localhost", it is the IPv6 equivalent of 127.0.0.1, you can read more about it at the Localhost's entry at wikipedia.