What is Private DNS? How to turn it on and test it

What Private DNS means on Android, which hostname to enter, how to test that your lookups are encrypted, and how to fix the usual connection errors.

6–10 minutes
Close-up of light travelling through fibre optic strands

Private DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS → is a setting, best known on Android, that encrypts the questions your device asks a DNS resolver so nobody on the network can read or change them. This guide is for anyone who has found the setting on a phone and wants to know what to type into it, and for people running Linux servers who want the same protection.

Private DNS sends your DNS lookups over an encrypted TLS connection (DNS over TLS, portPort A numbered door on a server. Each service listens behind its own door: web pages on 443, email on others, remote login on 22. More about Port → 853) instead of plain text on port 53. On Android, open Settings, search for Private DNS, choose Private DNS provider hostname and enter a resolver’s hostname such as dns.google, one.one.one.one or dns.quad9.net. Leave it on Automatic if you just want encryption whenever your network supports it, and test the result at one.one.one.one/help.

What Private DNS actually does

Before your phone can open example.com, it has to find the server’s IP addressIP address The number address of a device on the internet, like 203.0.113.10. Computers use it to find each other, the way post uses street addresses. More about IP address →. It asks a recursive resolver, a DNS server that looks up the answer for you. How DNS works follows that journey step by step.

Ordinary DNS questions travel as plain text on port 53. Anyone between you and the resolver can read them: the café Wi-Fi, the hotel network, your mobile operator. Even when the website itself loads over HTTPSHTTPS The secure version of the web, shown by the padlock. Everything sent between you and the site is scrambled so nobody in between can read or change it. More about HTTPS →, the name you looked up was visible first. Plain DNS can also be quietly changed in transit, so a hostile network could send you to the wrong address.

Private DNS wraps those questions in TLS, the same encryption HTTPS uses. The standard is called DNS over TLS (DoT), defined in RFC 7858, and it uses TCP port 853. The DNS port guide explains how 53, 853 and 443 fit together.

Two things change when Private DNS is on:

  • Nobody on the local network can read your lookups. They can still see that you are talking to a DNS resolver, and they can still see which IP addresses you then connect to.
  • Your device checks it is talking to the right resolver. The resolver must present a valid certificate for the hostname you entered, so an impostor cannot answer in its place.

What it does not do: it does not hide your browsing from the resolver itself, it does not change your public IP address, and it is not a VPN. The company running the resolver still sees every name you look up, so choose one whose privacy policy you are happy with.

The three Android settings explained

Android has offered Private DNS since Android 9. The setting has three choices.

SettingWhat happensWhen to use it
OffPlain DNS to whatever resolver the network hands outOnly for troubleshooting
AutomaticTries DNS over TLS with the network’s own resolver, falls back to plain DNS if that failsThe default; safe on every network
Private DNS provider hostnameAlways uses DNS over TLS to the resolver you name, never falls backWhen you want guaranteed encryption and a resolver you chose

Automatic is opportunistic: it encrypts when it can, but most home routers and many mobile networks do not offer DNS over TLS, so in practice it often sends plain DNS without telling you. It also has no hostname to check a certificate against.

Provider hostname is strict. If the resolver cannot be reached on port 853, or its certificate does not match, lookups fail rather than drop back to plain text. That is the point of it, and also the cause of almost every problem people report.

How to set Private DNS on Android

The menu path varies between makers and versions. The quickest route on any phone is the search box at the top of Settings.

  1. Open Settings and search for Private DNS. On stock Android and Pixel phones it is under Network & internet. On Samsung phones it is under Connections, then More connection settings.
  2. Tap Private DNS and choose Private DNS provider hostname.
  3. Type the hostname of the resolver you want. It is a name, not an IP address, and it has no https:// in front.
  4. Tap Save.
  5. Open a website. If it loads, the resolver is answering over TLS.

The setting applies to Wi-Fi and mobile data alike, so you only set it once.

Hostnames for the common public resolvers

ResolverHostname to enterMore detail
Google Public DNSdns.googleGoogle DNS
Cloudflareone.one.one.oneAlso accepts 1dot1dot1dot1.cloudflare-dns.com
Quad9 (blocks known malicious domains)dns.quad9.netQuad9 DNS

If you typed an IP address such as 8.8.8.8 into the box, it will not work. Android needs the hostname so it can check the certificate.

iPhone, iPad and computers

iOS and iPadOS have no Private DNS switch in Settings. Encrypted DNS there comes from a configuration profile or an app published by the DNS provider. Windows 11 can encrypt DNS with DNS over HTTPS from the DNS server settings for each network adapter, and most browsers have their own “secure DNS” option. Those use port 443 rather than 853, but the idea is the same.

How to check Private DNS is working

The simplest test is a web page that reports which protocol your lookups arrived on. Open one.one.one.one/help in a browser on the phone. With Cloudflare set as your Private DNS hostname, the line Using DNS over TLS (DoT) should say Yes. With other resolvers that page will not report DoT, so use your resolver’s own test page where one exists (Quad9 offers on.quad9.net).

To see which resolver is really answering, rather than which one you think you set, the DNS leak test guide shows a command-line method that works from any computer on the same network.

If you want to confirm that a network lets port 853 through at all, run this from a laptop on the same Wi-Fi:

nc -vz 1.1.1.1 853

A line containing succeeded or open means the port is reachable. A timeout means the network blocks DNS over TLS, and a phone set to a provider hostname will lose DNS on that network. The port checker guide explains how to read each result.

Private DNS on a Linux server

Servers make DNS lookups too: to fetch updates, deliver email and call APIs. On Ubuntu and Debian systems that use systemd-resolved, you can turn on DNS over TLS in one file.

  1. Open the configuration file:
sudo nano /etc/systemd/resolved.conf
  1. In the [Resolve] section, set the resolvers and turn on TLS. The part after # is the hostname the certificate must match:
[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net
DNSOverTLS=yes
  1. Restart the service and check the result:
sudo systemctl restart systemd-resolved
resolvectl status

The output should list your servers and show +DNSOverTLS in the protocols line. Then test a lookup:

resolvectl query example.com

DNSOverTLS=yes is strict, like Android’s hostname mode: if port 853 is blocked, lookups fail. DNSOverTLS=opportunistic behaves like Automatic and falls back to plain DNS. On a server, a failed lookup can stop updates and outgoing mail, so test before you leave it running, and keep a console or other way in.

Some hosting providers replace /etc/resolv.conf or set DNS through netplan or cloud-init. If your change disappears after a reboot, check resolvectl status again and set the DNS servers in the place your provider’s image manages them.

The other meaning: private DNS for internal networks

In business and cloud settings, “private DNS” often means something different: a DNS zone that only answers inside your own network. For example, db.internal.example.com might resolve to 192.0.2.20 for servers in your office or cloud network, and not resolve at all from the internet. Cloud platforms call these private zones or private hosted zones.

The same idea at home is a local DNS server on a router or small box that names your printers and NAS. For home networks, home.arpa is the name reserved for this purpose (RFC 8375). Avoid inventing top-level names, and avoid .local, which devices use for multicast name discovery.

This kind of private DNS is about which records exist and who can see them. Android’s Private DNS is about encrypting the lookup. The two can be used together.

Common problems

SymptomCauseFix
“Private DNS server cannot be accessed” and no websites loadThe network blocks port 853 or the hostname is mistypedCheck the spelling, then switch to Automatic on that network
Hotel or café Wi-Fi sign-in page never appearsThe login portal needs plain DNS before you are allowed onlineSet Private DNS to Automatic, sign in, then switch back
Setting saves but nothing worksAn IP address was entered instead of a hostnameEnter a hostname such as dns.google
Work apps or intranet sites stop loadingYour company’s internal names only resolve on its own resolverUse Automatic on the work network
Linux server cannot resolve anything after the changeOutbound TCP 853 blocked by a firewall or the providerAllow outbound 853, or use opportunistic mode
A site you just moved still shows the old serverThe new resolver has a cached answerWait for the TTL to expire; see DNS propagation

Official documentation

Get the next guide

One email when there is something worth reading: new guides, errors going around, and hosting changes that affect your site.

No tracking pixels, and one click to leave.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.