VPN connected on Android, but no internet: check Private DNS

If the VPN on your Android phone says Connected but no site opens, look at Private DNS first. When it is set to a provider's hostname, the phone sends every name lookup only to that server, over TLS on port 853. If the VPN or the network doesn't let that through, names stop resolving while connections by IP address still work. Setting Private DNS to Automatic fixes it at once; Off works too.

Updated

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.google or 1dot1dot1dot1.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. 1

    Open a site by its IP address

    With the VPN on, open https://1.1.1.1 in the browser. If that page loads but example.com doesn't, connections work and only names fail.

  2. 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. 3

    Read the browser's error

    Chrome shows ERR_NAME_NOT_RESOLVED or a DNS_PROBE_… error when names fail. A timeout on a site that does resolve points elsewhere.

  4. 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.

Computer with adb: Terminal or PowerShell
adb shell settings get global private_dns_mode
adb shell settings get global private_dns_specifier

The first line answers off, opportunistic (Automatic) or hostname. With hostname, the second one shows the server the phone insists on.

Computer with adb: Terminal or PowerShell
adb shell ping -c 3 1.1.1.1
adb shell ping -c 3 example.com

With the VPN on: if the first answers and the second says unknown host, connections work and names don't.

Computer with adb: Terminal or PowerShell
adb shell settings put global private_dns_mode opportunistic

Sets 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.

Windows: PowerShell
Test-NetConnection dns.google -Port 853

TcpTestSucceeded : True — port 853 opens from here. Put your provider's hostname in place of dns.google.

macOS, Linux or your VPN server: Terminal
nc -vz -w 5 dns.google 853

succeeded — 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.

In Veli

Names and connections, checked side by side

In Veli on Android, Diagnostics → “Check everything” looks at the network too, with “Name resolution (DNS)” and “Ping 1.1.1.1” as separate lines next to “Internet access (HTTPS)”. If the DNS line says the address of cloudflare.com could not be resolved while the ping answers, the connection is there and only names fail: the picture an unreachable Private DNS server gives. The next tab is the connection log.

Private DNS is Android's own setting, so you change it in the phone's Settings, not in the app. With Automatic or Off, the phone asks the DNS server the VPN gives it, through the tunnel. If the DNS line is fine and sites still won't open, the cause is elsewhere: the same check looks at whether your sites open through the current connection, and the log shows how the connection went.

FAQ

Why does my VPN say connected on Android but nothing loads?

Often Private DNS is set to a provider's hostname that the phone can't reach through the tunnel, so names stop resolving. Set Private DNS to Automatic and try again.

Should Private DNS be on or off with a VPN?

Automatic is the safe choice: the phone uses the VPN's DNS server and falls back to ordinary DNS where TLS isn't offered. Off works too; a hostname only if it answers through your VPN.

Does Private DNS bypass the VPN?

Not the tunnel: with a VPN that carries all traffic, its lookups go through the tunnel like the rest. It does bypass the VPN's own DNS server, so DNS filters in the VPN don't see the names.

What is port 853?

The standard port of DNS over TLS. If a network or a VPN server doesn't let it through, Private DNS with a hostname can't work there.

Is there the same problem on a computer?

In browsers, yes. Firefox in its strictest DNS over HTTPS mode, and Chrome or Edge with a provider chosen in their secure DNS setting, ask only that provider, so the browser fails while other programs work.

See whether names or connections fail

Diagnostics in Veli on Android checks name resolution and a ping to 1.1.1.1 as separate lines, so a DNS problem shows up as one failed line.