15

I recently updated Chrome on my developer machine to v45. This update seems to set my client Ip to always use IpV6. Some of the applications I am developing locally require me to use Ipv4 so I need to disable Ipv6 on chrome. I tried solutions mentioned in

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

but that doesn't seem to resolve my problem.

Community
  • 1
  • 1
KnightFox
  • 3,132
  • 4
  • 20
  • 35

2 Answers2

9

Short answer

The Chrome's method for resolving names (async-dns) is ignoring the OS's IPv4/IPv6 precedence.

You can try to launch Chrome from the console with the flag --disable-async-dns but, obviously, you'll loose that functionality.

Long answer

There are two reasons because you can't disable IPv6 in Chrome:

  • Google is not providing anymore the option to deactivate IPv6 since 1149303005.
  • Your OS must implement the "policy table" described in RFC3484. With it you should be able to give IPv4 precedence for all applications, inclunding Chrome. Nevertheless, Chrome is not working as expected: there is a known issue 516305 not fixed.

So you must disable "async dns" or you have to hack it out of Chrome, for example:

  • Using the etc/hosts file.
  • Choose (or deploy) an IPv4-only DNS and configure it in your OS's network configuration.
  • Install a web proxy with IPv6 disabled, then configure Chrome for using it.
jac
  • 101
  • 5
  • 7
    I just wanted to add that the `--disable-async-dns` flag was removed; see [here](https://codereview.chromium.org/1149303005) for the details. If it wasn't removed, at the very least it doesn't seem to do anything anymore on Windows. *sigh* back to developing using Firefox... – FireSBurnsmuP Jan 22 '16 at 21:37
  • 2
    Previous link is wrong link. [see here](https://code.google.com/p/chromium/issues/detail?id=432236) for the actual details. Of course it was after the edit timeout that I noticed. – FireSBurnsmuP Jan 22 '16 at 21:49
1

If you are on windows, you can add the ipv4 address and the hostname to the hosts file (located: c:\windows\System32\drivers\etc\hosts). Then the browser does not look up the dns to get the ip address but uses the ip address that you have provided in the hosts file.

On ios/mac the hostfile is located here: /private/etc/hosts

Bo Pennings
  • 945
  • 1
  • 10
  • 20
  • That solved my issue, thanks! And to know the IPv4 of the hostname: `ping -4 your-host.com` – DLight Feb 27 '21 at 16:27