On this page
What Private DNS is
Private DNS is Android's built-in DNS over TLS, there since Android 9. Normally the phone sends name lookups in the clear; with Private DNS it wraps them in TLS, so the network sees that you talk to a DNS server, but not which names you ask for. There are three modes:
- Off — ordinary DNS on port 53, to the server the network, or the VPN, gives the phone.
- Automatic — the default. The phone tries DNS over TLS with that same server, and if it doesn't answer on port 853, quietly uses ordinary DNS.
- Private DNS provider hostname — you type a name such as
dns.googleor1dot1dot1dot1.cloudflare-dns.com, often to block ads. The phone then asks only that server and only over TLS, with no way back. If the server can't be reached, no name resolves at all.
Why the VPN breaks with a hostname set
A VPN usually gives the phone a DNS server of its own, reached through the tunnel. With Private DNS on Automatic or Off, lookups go there and everything works as the VPN expects. With a hostname set, Android ignores the VPN's DNS server and keeps talking to the provider you chose, now through the tunnel.
That needs three things to pass: the ordinary lookup that turns the provider's name into an address, a connection to that address on port 853, and the TLS handshake on it. Some VPN servers and networks don't let port 853 through, some block popular DNS providers, and a VPN that sends only chosen addresses into the tunnel can leave the DNS server with no way out. Any one of these, and the phone can't look up a single name, while apps that connect by IP address keep working. So the VPN shows Connected and the browser says the site can't be found.
How to tell it's Private DNS
- 1
Open a site by its IP address
With the VPN on, open
https://1.1.1.1in the browser. If that page loads butexample.comdoesn't, connections work and only names fail. - 2
Look at the network's status
When strict Private DNS fails, the Wi-Fi or mobile network details say “Private DNS server cannot be accessed”, and the signal icon may get an exclamation mark.
- 3
Read the browser's error
Chrome shows
ERR_NAME_NOT_RESOLVEDor aDNS_PROBE_…error when names fail. A timeout on a site that does resolve points elsewhere. - 4
Switch to Automatic for a minute
If sites open the moment you change it, you've found the cause. Usually there's nothing else to do, often not even a reconnect.
What you see, why, and what to do
Sites by IP open, by name they don't, with the VPN on
CausePrivate DNS is set to a hostname the phone can't reach through the tunnel
What to doSet Private DNS to Automatic or Off
“Private DNS server cannot be accessed” under the network's name
CauseThe provider doesn't answer over TLS on port 853 from here
What to doAutomatic, or another provider that does answer
Fine without the VPN, names fail as soon as it connects
CauseThe VPN server doesn't let port 853 out, or the tunnel leaves the DNS server without a route
What to doAutomatic, or a provider that works through this server
Fine on Wi-Fi, names fail on mobile data, or the other way round
CauseOne network blocks port 853 or the provider, and strict mode has no fallback
What to doAutomatic: the VPN's DNS then answers on every network
The VPN's ad blocking or DNS filter does nothing
CauseLookups go to your Private DNS provider, past the VPN's DNS server
What to doAutomatic, so the VPN's DNS server answers
A DNS leak test shows a resolver you didn't pick in the VPN
CauseYour Private DNS provider answers, through the tunnel
What to doNot a leak to your ISP; pick Automatic if you want the VPN's DNS
Nothing resolves right after you typed a hostname
CauseA typo, or a name that isn't a DNS over TLS server
What to doCompare it with the provider's instructions, letter by letter
Where the setting is
The path differs between brands; the quickest way is to type “DNS” into the search at the top of Settings.
- Pixel and phones close to stock Android — Settings → Network & internet → Private DNS. On Android 9 it sits under Advanced.
- Samsung — Settings → Connections → More connection settings → Private DNS.
- Xiaomi — Settings → Connection & sharing → Private DNS.
- What to pick — Automatic for everyday use with a VPN. Off is just as good: lookups go to the VPN's DNS server, protected by the tunnel itself. A hostname only if you know it works through your VPN.
Check it from a computer
With USB debugging on, adb shows the setting and tells names from connections without hunting through menus.
adb shell settings get global private_dns_mode
adb shell settings get global private_dns_specifierThe first line answers off, opportunistic (Automatic) or hostname. With hostname, the second one shows the server the phone insists on.
adb shell ping -c 3 1.1.1.1
adb shell ping -c 3 example.comWith the VPN on: if the first answers and the second says unknown host, connections work and names don't.
adb shell settings put global private_dns_mode opportunisticSets Automatic; off in its place turns Private DNS off. Set a hostname again in Settings, where the phone checks the server first.
If you want to keep Private DNS with the VPN
A hostname is a fine choice when it works through your VPN: lookups are encrypted twice and go to a resolver you picked. Check that the provider answers on port 853 from where the VPN comes out: on your own VPN server, or from a computer connected through the same VPN.
Test-NetConnection dns.google -Port 853TcpTestSucceeded : True — port 853 opens from here. Put your provider's hostname in place of dns.google.
nc -vz -w 5 dns.google 853succeeded — it opens, and strict mode should work through this path. No answer within 5 seconds — DNS over TLS doesn't pass: use Automatic with this VPN, or another provider.
