Skip to content

IPv6 and IPv4 preference

Most people should use the default automatic network settings. Keep IPv6 enabled on your device: the office network provides public IPv4 and public IPv6, and some internal services are reachable only over IPv6.

The office IPv6 prefix is stable, but your device address can still change. Modern operating systems use IPv6 privacy addresses, so the exact public IPv6 shown by a check site can rotate while staying inside the office prefix. A check site can report missing reverse DNS for that address; this is normal for client devices.

On some networks, IPv6 is provided through a tunnel. That can make IPv6 slower or less reliable than native IPv4 for websites that support both protocols. If that happens, prefer IPv4 on your device instead of disabling IPv6. IPv6 stays available for IPv6-only services, while dual-stack services use IPv4 first.

On Ubuntu and other glibc-based distributions, prefer IPv4 by adding this policy line:

Terminal window
sudo sh -c "grep -q '^precedence ::ffff:0:0/96 100' /etc/gai.conf || printf '\nprecedence ::ffff:0:0/96 100\n' >> /etc/gai.conf"

Restart applications that already have network connections open.

Check the address order:

Terminal window
getent ahosts example.com

This setting affects applications that use the system resolver. Some browsers, containers, and statically linked tools may use their own address selection.

Run PowerShell or Command Prompt as Administrator.

Show the current policy table:

Terminal window
netsh interface ipv6 show prefixpolicies

Prefer IPv4:

Terminal window
netsh interface ipv6 set prefixpolicy ::ffff:0:0/96 100 4

Keep IPv6 set to automatic. These systems do not provide a normal global switch that prefers IPv4 while keeping IPv6 available for IPv6-only services.

For command-line testing on macOS, use application-specific options:

Terminal window
curl -4 https://example.com
curl -6 https://example.com

Do not turn IPv6 off when you need access to IPv6-only services.