This is an automated archive made by the Lemmit Bot.

The original was posted on /r/ipv6 by /u/DragonfruitNeat8979 on 2023-06-29 13:46:34+00:00.


I found a way to make Android treat IPv4-only WiFi networks as having no internet connectivity. You might want to do this if you always need to have access to IPv6-only destinations from an Android device, even without a VPN.

By default, Android makes an HTTP request to a dual stack domain: http://connectivitycheck.gstatic.com. If that request fails, the network is considered to have no internet connectivity.

It turns out that if the Private DNS (DoT) setting is set, Android also checks if the DoT server is reachable. If the DoT server is unreachable, the network is also flagged as having no internet connectivity and Android prefers cellular or other WiFi networks.

If there’s a WiFi network in range on which the server is unreachable and cellular is available, Android will use cellular.

If there are two WiFi networks in range, Android will select the one where the server is available over the network on which the server is unreachable.

If that server is IPv4-only, Android will flag IPv6-only networks without NAT64 as having no internet connectivity.

If the server is dual stack, both IPv6-only networks without NAT64 and IPv4-only networks will be treated as having a internet connection.

There’s just one caveat, though: if the server is unreachable, Android won’t have DNS, so it won’t have an internet connection. It’s something to keep in mind, especially if setting the server to a self-hosted one that could go down. So, if there’s a WiFi network in range on which the server is unreachable and cellular is unavailable, Android won’t have DNS on that WiFi network at all. That means Android also won’t even do local DNS on a network without internet connectivity. Warning: this also applies to cellular. If the server is unreachable on your cellular connection, you won’t have internet connectivity. Even if the home cellular network can reach the server, the networks used for roaming may not be able to reach the DoT server (for example if they’re IPv4-only).

But if the server is IPv6-only, Android will flag IPv4-only networks as having no internet connectivity.

So to make Android ignore IPv4-only WiFi networks, it’s as simple as setting the DoT server address to an IPv6-only server. In fact, it’s not even necessary to self-host your own DoT server if it’s acceptable to use Cloudflare DNS as the DoT server because Cloudflare provides a helpful ipv6.cloudflare-dns.com domain that only has an AAAA record.