Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active September 12, 2025 13:30
Show Gist options
  • Select an option

  • Save plembo/b9fba5f04c84ff63beda10b603984273 to your computer and use it in GitHub Desktop.

Select an option

Save plembo/b9fba5f04c84ff63beda10b603984273 to your computer and use it in GitHub Desktop.
Notes on DNS for Android

Notes on local DNS for Android

Recent releases of Android famously ignore/bypass any local (i.e., self-hosted) nameserver passed along by DHCP or specified in a wifi profile, in favor of Google's own public nameservers. The only other option is to enable "Private DNS" (DNS over HTTPS, or DoH) in the global network settings for your devices. The stated reason for this are easy to understand: to avoid compromising security or privacy when connecting to random wifi networks. But we all know there's more to it than that. The most charitable explanation would be that Google (and others, including Mozilla) is fixated on getting everyone on DoH, even at the cost of frustrating we few peasants who want to run our own local DNS. Let them eat cake.

There are a few alternatives available to those of us who would like to address local hosts and services on our home networks by name, rather than IP address:

  1. Apple mDNS. Like Microsoft's legacy WINS, mDNS still isn't very reliable and won't work for hosts and devices that don't have an mDNS client. I avoid using mDNS whenever I can.
  2. An Android app (e.g., DNS Changer by App Planex) that uses a dummy VPN to route all DNS queries to your local name servers. You'll usually turn this on only when you need to resolve local host names.
  3. A network-oriented solution like Cloudflare's Tunnel that tunnels DNS queries from the Internet by authorized clients to a nameserver on your private network. This is more complicated to set up, and requires tighter integration with your DNS provider. It is what I'd recommend for enterprises or small businesses.
  4. Adding your local network private-range IP addresses to your domain's public DNS records (so, an "A" record for bigserver.example.com at 10.0.1.25). This is the simplest solution. Your router/firewall should prevent anything outside your private network from reaching your internal hosts. Android devices would be configured to use the DoH address of your public DNS provider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment