Is there a way to disable IPv6 in Google's Chrome?

I'm developing websites in a Windows 7 machine.

When I've installed Firefox I've found some performance issue specially on connecting to the localhost, googling around I've discovered that it's related to the use of IPv6 by the browser to resolve urls.

Using about: config and setting network.dns.disableIPv6 to true the problem is gone.

Now I've the same issue with Google Chrome, but I can't find a way (if there's a way) to do the same I've done with Firefox.

Any suggestions?


From: https://stackoverflow.com/questions/1726585/firefox-and-chrome-slow-on-localhost-known-fix-doesnt-work-on-windows-7

Edit your "hosts" file on your computer to make sure there is an ipv4 style localhost entry there. Go to:

C:\Windows\System32\drivers\etc\hosts

Make sure there is a line that looks like

127.0.0.1       localhost

And make sure the line with the ipv6 style is commented out (with #)

#   ::1             localhost

You'll have to run your editor w/ admin mode to be able to save the changes. I had this problem before and this change fixed it for me. It doesn't disable ipv6 on your computer, it just tells it to use ipv4 for localhost lookups.


Start Chrome with the command line flag --disable-ipv6


The --disable-ipv6 flag is no longer working (1149303005), so the way to go is using the policy table (RFC3484) implementation of your OS:

  • Windows: google netsh prefixpolicies.
  • Linux: edit /etc/gai.conf.

Unfortunately, Chrome's method for resolving names (async-dns) is ignoring the OS's IPv4/IPv6 precedence, so:

  • Launching Chrome from the console with the flag --disable-async-dns will do the trick but, obviously, you'll loose that functionality.
  • Hopefully, Google will solve the issue 516305 some day :-)