views:

1690

answers:

2

Firefox and Chrome are known to be slow on localhost when IP6 is enabled. In previous versions of Windows, the simplest fix is to comment out this line from the hosts file, as explained in the answer to this question.

::1 localhost

However, as noted in this question, in Windows 7 this line is already commented out:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1 localhost
#   ::1 localhost

Is there an alternative way to disable the ::1 localhost reference in Windows 7?

+9  A: 

Still think it belongs on superuser, but looked it up anyway as I'm a FF fan :) It turns out that the slowness is caused by an IPv6 issue with DNS and can easily be resolved by turning IPv6 support off in Firefox while doing localhost testing. To make the change, type

about:config

in the address bar, locate the

network.dns.disableIPv6

setting and double-click on it to set it to true. This does the trick for the Firefox localhost issue on Vista and everything is running fast again.

http://kb.mozillazine.org/Network.dns.disableIPv6 has all the info you probably need - good luck!

Mark Mayo
Great, thanks. I tried this and it works. I'd still like to see a solution for Chrome.
Herb Caudill
This is a well known FF issue. I always turn ipv6 off on my local dev machine.
Pure.Krome
Personally I prefer adding `localhost` to `network.dns.ipv4OnlyDomains` rather than turning off ipv6 entirely. I know it doesn't make much difference now but I can't shake the feeling I'll forget I did this some day and wonder why ipv6 sites won't load
Tim Schneider
+15  A: 

Turns out if you uncomment the 127.0.0.1 line in the hosts file, Chrome goes back to its snappy self on localhost URLs.

# localhost name resolution is handled within DNS itself.
    127.0.0.1 localhost

The hosts file is typically at C:\WINDOWS\system32\drivers\etc\hosts. To edit it in Win7, you'll need to run Notepad as administrator.

Herb Caudill
+1, Thanks for this -- made a huge differece in my loading times (5-10 seconds to <1 second).
Jerad Rose
I presume this also works for FF; or do you have to add local host to the IPV4 only domains for FF.
Software Monkey