"Private DNS server cannot be accessed" on Android means your phone tried to open an encrypted DNS over TLS connection to the hostname in Settings and failed. To fix it, correct the hostname, test whether another network (mobile data) works, and if the network is blocking the connection, set Private DNS to Automatic or Off.
The exact wording differs between phone makers and Android versions. Google's own help page does not list this message, so treat the text as a symptom rather than a documented error code. The usual signs are a Wi-Fi or mobile network that shows "connected" but loads nothing, or a warning when you save the hostname.
What Private DNS does on Android
Private DNS is Android's setting for DNS over TLS (DoT). Instead of sending domain lookups in plain text, the phone wraps them in a TLS connection to a DNS server. Google's help page lists three modes: Off, Automatic and Private DNS provider hostname. By default, the device uses Private DNS on networks that support it. You find the setting under Settings, in the network section, by opening Private DNS, choosing a mode and tapping Save. Some menu names move between manufacturers, so if you cannot see it, search Settings for "Private DNS".
The mode matters for this error:
| Mode | What the phone does | Can it produce this error? |
|---|---|---|
| Off | Sends DNS in plain text to the network's DNS server | No |
| Automatic | Uses encryption if the network's DNS server supports it, otherwise plain DNS | Rarely |
| Private DNS provider hostname | Requires an encrypted connection to the hostname you entered | Yes |
The mismatch is deliberate. When you enter a hostname, Android's 2018 announcement of the feature says it sends all DNS queries over a secure channel to that server, and it marks the network as "No internet access" if it cannot reach the server. That is the same idea as the Strict Privacy profile in RFC 8310: encryption and authentication are required, and "a hard failure occurs if this is not available." A phone in this mode does not fall back to plain DNS, because falling back would defeat the reason you picked a private provider. That is as designed, and it is why one broken hostname can take down the whole connection. Note the Android post describes the original Android P preview, so later versions may differ in detail.
Step 1: Check the hostname
A typo is the cheapest cause to rule out. Open the Private DNS setting and compare the field with your provider's documentation for DNS over TLS. Common mistakes:
- Pasting a DNS over HTTPS address such as
https://dns.example.com/dns-query. The field takes only the hostname, heredns.example.com. DoH and DoT are different protocols, covered in DNS over HTTPS explained. - Entering an IP address. The field expects a hostname, because the phone checks the server's certificate against that name.
- Adding a port number or a trailing slash.
- Using a profile hostname that was deleted or changed in your provider's dashboard. Some providers give each account its own hostname.
- Extra spaces from copy and paste.
Retype the hostname by hand and save. If the error clears, that was the cause.
Step 2: Try a different network
Switch Wi-Fi off and use mobile data, or connect to a different Wi-Fi network, with the same hostname still set. This one test splits the problem in two:
- Works on mobile data, fails on one Wi-Fi network. The Wi-Fi network is the problem. Go to step 3.
- Fails everywhere. The hostname is wrong or the provider is down. Check the provider's status page, or use a hostname from a different provider to see if the setting works at all.
Step 3: Port 853 may be blocked
RFC 7858 sets TCP port 853 as the default port for DNS over TLS and forbids using that port for plain-text DNS. A router, firewall, school or office network, or a parental-control feature can block outgoing connections to port 853. Android's feature needs no inbound ports on your router, only the phone's outgoing connection to reach the DNS server.
Signs of a block: the error appears only on one network, and the same hostname is accepted on mobile data. A connection that opens but never completes a TLS handshake looks the same to the user, so you cannot tell the two apart from the phone alone. If you manage the router, check its firewall and any DNS filtering or "DNS hijack" option, and allow outgoing TCP 853. If you do not manage it, you can ask the network's owner, or use the options below.
On a Windows PC, you can test whether a DoT server accepts a TCP connection on the same network as your phone with this PowerShell command (replace the hostname with your provider's):
Test-NetConnection -ComputerName dns.example.com -Port 853
Example output when the port is reachable:
ComputerName : dns.example.com
RemotePort : 853
TcpTestSucceeded : True
TcpTestSucceeded : False means the connection was refused or dropped before TLS began. A True result does not prove DoT works, since the TLS handshake can still fail, but it rules out a plain port block. If your PC and phone share the Wi-Fi network, the result applies to both.
Step 4: Change the mode to get online
If you cannot fix the network, pick the least-bad option for your situation:
- Set Private DNS to Automatic. The phone still uses encryption when the network's DNS server supports it, and works normally when it does not. This is the best choice on networks you do not control.
- Set Private DNS to Off. Use this only to recover a connection. Lookups are then unencrypted, so anyone on the network path can see the domain names you request.
- Use a different DoT hostname from another provider, if the failing one is unreachable from that network.
Whichever you pick, remember what Google's help page says about the limits: Private DNS secures DNS lookups only and does not protect other traffic.
Other causes worth checking
- A VPN or ad-blocking app. Apps that set up their own local VPN can take over DNS. Turn the VPN off and retry with the hostname set. Android Help does not cover VPN interaction in detail, so test rather than assume.
- A captive portal. Hotel and airport Wi-Fi often block everything until you sign in. Open any plain
http://page to trigger the sign-in screen, then retry. - Wrong date and time. TLS certificate checks depend on the clock. A phone with the wrong date can reject a valid server certificate. Turn on automatic date and time.
- The router's own DNS. If other devices on the Wi-Fi also lose DNS, work through DNS server not responding instead.
Check that the setting is working
After a change, load a page you have not visited recently, or open a lookup site on the phone. To see which DNS server your devices use at all, see check which DNS server you are using. A provider's own test page can also say whether your queries arrive over DoT, though Android does not show a live status for it.
If it still fails
Restart the phone, toggle airplane mode, and forget and re-add the Wi-Fi network so Android re-runs its connectivity check. If the error follows you across every network and every hostname you try, save the hostname after setting the mode to Off once, then switch back to the hostname. If that fails too, contact the manufacturer, which is the route Google's help page suggests when the setting itself is missing or misbehaving.
Frequently asked questions
- What does "private DNS server cannot be accessed" mean on Android?
- It means your phone is set to a Private DNS provider hostname, and it could not set up an encrypted DNS over TLS connection to that server. Because the setting requires encryption, Android does not quietly send your lookups unencrypted. The network is treated as having no working internet until the server becomes reachable or you change the setting.
- Is it safe to turn Private DNS off?
- It is safe in the sense that nothing breaks, but your DNS lookups are then sent without encryption, so anyone on the network path can read which domain names you look up. Private DNS only protects DNS lookups, not the rest of your traffic. Automatic mode is a better default than Off, because it uses encryption only when the network's DNS server supports it.
- Why does Private DNS work on mobile data but not on Wi-Fi?
- Most often the Wi-Fi network, router or firewall blocks outgoing TCP port 853, which DNS over TLS uses by default, or interferes with the TLS handshake. Mobile data uses a different network path that may not have that block. Test the same hostname on both to confirm where the problem is.
- Which hostname should I enter in the Private DNS field?
- Enter the hostname your DNS provider documents for DNS over TLS, with no https:// prefix, no path and no port number. It must be a name, not an IP address. A copied DNS over HTTPS URL will not work in this field.