How to let the browser prefer IPv6 over IPv4?

It is not the browsers preferring any of the options, it's the operating system. The standard defines the priorities roughly like this:

  1. ipv6
  2. ipv4
  3. 6to4-Traffic

You can change this by editing the label/precedence blocks in /etc/gai.conf (gai stands for getaddrinfo, the standard system call for resolving host names).

A detailed explanation on gai.conf can be found in the man page

This, by the way, also explains Jonathon's experience that the SiXXS tunnel was preferred over 6to4.


For Firefox & other Mozilla/Gecko-based browsers, the network.dns.disableIPv6 setting in about:config should be false if you have IPv6 (it's set to true by default in Ubuntu, because otherwise lots of people get issues with buggy DNS proxies in home routers).


As of recent, Chrome, Firefox as well as derived browsers actually avoid IPv6 if a site responds faster over IPv4. It is not possible to change this behavior by means of a configuration setting.

The feature itself is probably reasonable for the common user but it almost drives me mad that you cannot disable it. IPv6 connectivity is pretty good nowadays and sometimes IPv6 has several advantages over connecting through IPv4 even if latency - due to tunneling - is higher. I've been browsing over IPv6 for years and despite IPv6 routing and performance has been getting much better, this damn browser "hack" feature throws me back a decade.

Tags:

Ipv6