DNS over HTTPS vs DNS over TLS: Encrypted DNS Explained (2026)
DoH and DoT both encrypt your DNS lookups, but one hides in web traffic and the other sits on its own port. Here’s how they differ and how to turn them on.

Your browser padlock protects the page. It doesn’t protect the question you asked first.
Before any site loads, your device asks a DNS server for its address. On most networks, that question still travels as plain text. Your ISP, the café Wi-Fi and anyone else on the path can read every domain you look up, and some of them log it.
DNS over HTTPS (DoH) and DNS over TLS (DoT) both fix that by encrypting the lookup. They do it in different ways, though, and the difference decides who can still block or monitor you.
We queried both protocols from scratch in Python to see how they behave, then mapped how to switch them on across every major browser and operating system.
- Plain DNS shows every domain you look up to anyone on the network.
- DoH and DoT use the same strong encryption but very different ports.
- DoH is harder to block, while DoT is easier for networks to manage.
- Encrypted DNS hides lookups, not the IP addresses you connect to.
- Your chosen resolver still sees everything, so choose it carefully.
What Plain DNS Gives Away
Classic DNS sends every lookup unencrypted over UDP port 53, so anyone on the network path can read and even change it. That includes your ISP, the hotspot owner and whoever controls the router.
A DNS query is tiny, but it’s revealing. It’s one of several ways you get tracked online, and one of the easiest to fix. It says “this device wants mybank.com at 9:14 PM,” then “a health clinic,” then “a job site.” Even with HTTPS everywhere, that list paints a surprisingly detailed picture of a day.
It’s also editable. Because plain DNS has no encryption or integrity check on the wire, a network can answer with a different IP. That’s how some ISPs redirect typos to ad pages and how some countries block sites. It’s also a classic attack on public Wi-Fi.
We covered the visibility side in our guides on whether your ISP can see incognito browsing and what Wi-Fi owners can see. Encrypted DNS is the fix for the DNS part of that story.
How DNS over HTTPS Works
DoH wraps each DNS query inside an ordinary HTTPS request to the resolver, on port 443. To the network, it looks like any other encrypted web traffic.
It’s defined in RFC 8484 (2018). The client takes the same binary DNS message classic DNS would send, then either POSTs it or base64url-encodes it into a ?dns= parameter on a GET. The content type is application/dns-message.
Because it rides on HTTPS, DoH shares port 443 with billions of web requests. A network can’t pick DoH out by port alone. It can only block known resolver addresses or hostnames like cloudflare-dns.com and dns.google.
That’s the feature privacy fans love and network admins hate. A school or office that filters by DNS loses that control when a browser quietly switches to DoH.
One detail many guides miss: RFC 8484 names HTTP/2 as the minimum recommended HTTP version. In our November 2026 test, Quad9’s DoH endpoint answered an HTTP/1.1 request with 505 HTTP Version Not Supported and worked fine over HTTP/2. If a homemade DoH client fails against one resolver and works against another, check the HTTP version first.
How DNS over TLS Works
DoT sends normal DNS messages through a TLS-encrypted connection on its own dedicated port, 853. It’s simpler than DoH but much easier to spot.
The standard is RFC 7858 (2016). The client opens TCP to the resolver on port 853, completes a TLS handshake and checks the certificate against a hostname. Then it sends DNS messages with a two-byte length prefix, exactly like DNS over TCP.
No HTTP layer is involved, so there’s less overhead per query. The trade-off is visibility: anything on port 853 is almost certainly DNS. A network that wants to force its own resolver can block 853 in one firewall rule, and many hotel and corporate networks do.
That’s also why DoT is the favorite of operating systems and routers. Android’s Private DNS, systemd-resolved on Linux and many router firmwares use it, because it encrypts the lookup while staying easy for admins to see and manage.
DoH vs DoT Side by Side
Both encrypt the same DNS messages with TLS. The real differences are the port, how hard they are to block, and which software supports them.
| DNS over HTTPS (DoH) | DNS over TLS (DoT) | |
|---|---|---|
| Standard | RFC 8484 (2018) | RFC 7858 (2016) |
| Port | 443, shared with web traffic | 853, dedicated |
| Transport | HTTPS (HTTP/2 recommended, HTTP/3 common) | TLS over TCP |
| Easy to block? | Hard. Must block resolver IPs or hostnames | Easy. Block port 853 |
| Visible as DNS to the network? | No, blends with HTTPS | Yes, by port |
| Typical home | Browsers, Windows 11, apps | Android Private DNS, Linux, routers |
| Overhead | Slightly more (HTTP headers) | Slightly less |
| Best for | Hostile networks, censorship, public Wi-Fi | Whole-device or whole-network encryption you manage |
Our take: for privacy on networks you don’t trust, DoH wins because it’s much harder to block or single out. For a home network or a company that wants encrypted DNS it can still see and govern, DoT is the cleaner fit. Security-wise, they’re equals.
DNSCrypt, DNS over QUIC and Oblivious DoH
DoH and DoT are the mainstream options, but three others fill specific gaps. You’ll see their names in apps like AdGuard and dnscrypt-proxy.
1DNSCrypt
DNSCrypt predates both and isn’t an IETF standard. It authenticates and encrypts DNS with its own lightweight protocol instead of TLS. It still has a loyal following, mostly through the open-source dnscrypt-proxy client, which also speaks DoH. For most people, DoH has replaced it.
2DNS over QUIC (DoQ)
Standardized in RFC 9250 (2022), DoQ runs DNS over QUIC, the UDP-based transport behind HTTP/3. It avoids TCP’s head-of-line blocking and reconnects quickly when your phone switches networks. Support is growing but still limited to specific apps and resolvers.
A close cousin, DoH over HTTP/3, is already mainstream on Android. Google’s security blog explained in July 2022 that Android 11 and later use DoH3 instead of DoT for well-known resolvers like Google and Cloudflare. In its field data, the switch cut median query time by 24% compared with DoT.
3Oblivious DoH (ODoH)
Plain DoH moves trust from your ISP to the resolver, which still sees your IP and every query. Oblivious DoH, described in RFC 9230, splits that knowledge. A relay sees your IP but not the query. The resolver sees the query but not your IP.
It’s the most private design on this list and the least supported. Think of it as where encrypted DNS is heading rather than something to set up today.
We Queried DoH and DoT From Scratch
Both protocols carry the exact same DNS message. Only the envelope changes. This script proves it using nothing but Python’s standard library.
"""Query the same name over DoH (RFC 8484) and DoT (RFC 7858) with only the standard library."""
import base64, socket, ssl, struct, time, urllib.request
def build_query(name, qtype=1): # qtype 1 = A record
header = struct.pack(">HHHHHH", 0, 0x0100, 1, 0, 0, 0) # ID 0, recursion desired
qname = b"".join(bytes([len(p)]) + p.encode() for p in name.split(".")) + b"\x00"
return header + qname + struct.pack(">HH", qtype, 1)
def parse_a_records(msg):
ancount = struct.unpack(">H", msg[6:8])[0]
i = 12
while msg[i]: i += msg[i] + 1 # skip question name
i += 5 # null byte + QTYPE + QCLASS
ips = []
for _ in range(ancount):
i += 2 if msg[i] & 0xC0 == 0xC0 else msg.index(b"\x00", i) - i + 1
rtype, _, _, rdlen = struct.unpack(">HHIH", msg[i:i + 10]); i += 10
if rtype == 1: ips.append(socket.inet_ntoa(msg[i:i + rdlen]))
i += rdlen
return ips
def doh(name, url="https://cloudflare-dns.com/dns-query"):
q = base64.urlsafe_b64encode(build_query(name)).rstrip(b"=").decode()
req = urllib.request.Request(f"{url}?dns={q}", headers={"accept": "application/dns-message"})
with urllib.request.urlopen(req, timeout=10) as r:
return parse_a_records(r.read())
def dot(name, server="1.1.1.1", hostname="cloudflare-dns.com"):
ctx = ssl.create_default_context()
with socket.create_connection((server, 853), timeout=10) as raw:
with ctx.wrap_socket(raw, server_hostname=hostname) as s:
q = build_query(name)
s.sendall(struct.pack(">H", len(q)) + q) # DoT adds a 2-byte length prefix
length = struct.unpack(">H", s.recv(2))[0]
data = b""
while len(data) < length: data += s.recv(length - len(data))
return parse_a_records(data)
for label, fn in (("DoH (port 443)", doh), ("DoT (port 853)", dot)):
t = time.perf_counter()
ips = fn("example.com")
print(f"{label}: {ips} in {(time.perf_counter() - t) * 1000:.0f} ms")It builds one raw DNS query for example.com, then sends it two ways. For DoH, it base64url-encodes the message into a GET request. For DoT, it opens TLS to port 853 and adds the two-byte length prefix. The same parser reads both answers.
We ran it against Cloudflare, Google and Quad9. Every resolver returned the same two addresses over both protocols, apart from Quad9’s DoH endpoint rejecting HTTP/1.1, as noted earlier.
Don’t read too much into the milliseconds. Each query opened a brand-new TLS connection, which dominates the time. Real clients keep connections open and reuse them, so the gap between DoH and DoT mostly disappears in daily use.
What Encrypted DNS Hides and What It Doesn’t
Encrypted DNS hides which domains you look up from the local network. It doesn’t hide where you connect next. That’s the part most marketing skips.
After the lookup, your browser connects to the site’s IP address. The network sees that IP. On a shared CDN that might not say much, but a dedicated server IP points straight at one site.
The TLS handshake also usually sends the site name in plain text as SNI. Encrypted Client Hello (ECH) can hide it, and here’s the twist: browsers fetch ECH keys from DNS. So ECH leans on encrypted DNS. Mozilla, for example, lists DoH as a prerequisite for ECH in Firefox.
| Who | Plain DNS | Encrypted DNS | Encrypted DNS + VPN |
|---|---|---|---|
| Wi-Fi owner or ISP sees the domains you look up | Yes | No | No |
| Wi-Fi owner or ISP sees the IPs you connect to | Yes | Yes | No (only the VPN server) |
| Can read the SNI site name | Yes | Yes, unless ECH is used | No |
| DNS resolver sees your queries | Yes (usually the ISP) | Yes (the resolver you chose) | Yes (the resolver in use) |
| Websites see your real IP | Yes | Yes | No |
The resolver row matters. Encrypted DNS doesn’t create privacy from nowhere. It moves the full list of your lookups from your ISP to a resolver you pick, so pick one whose privacy policy you actually trust.
Encrypted DNS and VPNs: How They Work Together
A good VPN already encrypts your DNS by sending it through the tunnel to its own resolver. Adding DoH on top can help or hurt, depending on how it’s set up.
When you connect, most VPN apps route DNS through the encrypted tunnel to a resolver they run. Your ISP sees only VPN traffic. If DNS escapes the tunnel instead, you have a DNS leak, and your ISP sees every domain again.
Now add browser DoH with a custom provider. The browser sends lookups to that provider instead of the VPN’s resolver. They still travel through the VPN tunnel, so your ISP sees nothing. But the DoH provider now sees your queries, linked to your VPN exit IP.
Common mistake: people run a DNS leak test, see Cloudflare or Google listed and panic. With browser DoH on, that’s expected. It isn’t a leak as long as the traffic still goes through the tunnel. It’s simply a different resolver than your VPN’s.
Chrome’s help page says secure DNS is on in automatic mode by default and falls back to unencrypted lookups if it runs into trouble. Firefox’s Default Protection steps aside in some situations, such as when it detects parental controls or enterprise policies.
Our take: with a trusted VPN, leave the browser on automatic and let the VPN handle DNS. Without a VPN, turn DoH on everywhere you can. You can compare VPNs that run their own encrypted DNS in our VPN directory.
How to Enable Encrypted DNS on Every Device
Browsers are the quickest win, the operating system covers every app, and the router covers every device. Pick the widest layer you control.
1Google Chrome
- Open the three-dot menu, then Settings.
- Go to Privacy and security, then Security.
- Turn on Use secure DNS.
- Keep your current provider, or choose a provider such as Cloudflare or Google from the list, or add a custom DoH URL.
Google’s Chrome help notes that a custom provider won’t fall back to unencrypted DNS, while automatic mode will. If your device is managed or parental controls are on, the setting is locked.
2Mozilla Firefox
- Open the menu, then Settings, then Privacy & Security.
- Scroll to the DNS over HTTPS section.
- Choose Increased Protection (falls back to normal DNS if DoH fails) or Max Protection (DoH only, shows an error instead of falling back).
- Pick a provider or choose Custom and paste a DoH URL.
To confirm, open about:networking#dns. Entries resolved over DoH show true in the TRR column.
3Microsoft Edge and Brave
In Edge, go to Settings, then Privacy, search, and services, then Security, and turn on Use secure DNS. In Brave, it’s under Settings, Privacy and security, Security. Both then let you keep your current provider or choose another one. These steps match Cloudflare’s browser setup documentation, checked November 2026.
4Windows 11
- Open Settings, then Network & internet, then Wi-Fi or Ethernet.
- Open your connection’s hardware properties and select Edit next to DNS server assignment.
- Switch to Manual, turn on IPv4 and enter a supported resolver, such as 1.1.1.1.
- Set DNS over HTTPS to On and save. Repeat for IPv6 if you use it.
Windows only offers DoH for resolvers on its known list. Microsoft’s documentation shows Cloudflare, Google and Quad9 addresses on that default list, and the Get-DnsClientDohServerAddress PowerShell cmdlet prints it. Admins can add others with Add-DnsClientDohServerAddress.
Windows also distinguishes between requiring encryption and allowing a fallback. On the server version, Microsoft’s doc calls the options “Encrypted only” and “Encrypted preferred, unencrypted allowed,” and warns that the second can switch to plain text without telling you.
5Android
- Open Settings and search for Private DNS (often under Network & internet or Connections, then More connection settings).
- Choose Private DNS provider hostname.
- Enter a hostname such as
one.one.one.one,dns.googleordns.quad9.net, then save.
Private DNS arrived in Android 9 and covers every app that uses the system resolver. Android’s developer blog warns that with a hostname set, Android marks the network “No internet access” if it can’t reach that server. A typo in the hostname looks exactly like a dead connection.
6iPhone, iPad and Mac
Apple has supported system-wide encrypted DNS since iOS 14 and macOS Big Sur, but there’s no simple toggle. You enable it by installing a DNS configuration profile from your resolver, or with a resolver’s own app that uses Apple’s DNS settings API. Cloudflare’s 1.1.1.1 app and many DNS filtering services work this way.
Safari has no DoH setting of its own. It follows the system. Firefox and Chrome on a Mac use their own settings described above.
7Linux
On distributions that use systemd-resolved, you can enable DoT system-wide in /etc/systemd/resolved.conf:
[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net
DNSOverTLS=yesRestart the service with sudo systemctl restart systemd-resolved, then check resolvectl status. The #hostname part lets it verify the resolver’s certificate. For DoH on Linux, a local forwarder such as dnscrypt-proxy is the usual route.
8Your Router
Router support depends on firmware.
Some consumer routers and most open firmware, like OpenWrt with the right packages, can forward every device’s DNS over DoT or DoH.
The upside is coverage for smart TVs and consoles that have no DNS settings. The downside is that the hop from each device to the router stays plain, which is fine at home but not on a shared network.
Picking a Resolver
The protocol keeps strangers out. The resolver you choose decides who sees your lookups instead. Here are the three big public options and the endpoints we tested in November 2026.
| Resolver | DoH URL | DoT hostname | Worth knowing |
|---|---|---|---|
| Cloudflare | https://cloudflare-dns.com/dns-query | one.one.one.one | Built into Firefox, Chrome, Edge and Brave menus |
| Google Public DNS | https://dns.google/dns-query | dns.google | Built into Chrome and Android |
| Quad9 | https://dns.quad9.net/dns-query | dns.quad9.net | Blocks known malicious domains; DoH needed HTTP/2 in our test |
Each publishes its own privacy policy and logging terms. Read them, because those terms are now the real privacy boundary for your DNS. If you need blocking, such as malware or adult-content filters for a family, filtering resolvers like Quad9 or Cloudflare’s 1.1.1.1 for Families add that on top.
How to Check Encrypted DNS Is Working
Don’t trust the toggle. Test it. Each check takes under a minute.
- Cloudflare users: visit Cloudflare’s 1.1.1.1 help page, which reports whether your browser is using DoH or DoT.
- Firefox:
about:networking#dnsshows which lookups went through DoH. - Android: if the Private DNS hostname is wrong, the network shows “No internet access” right away, which is a check in itself.
- Any device: a DNS leak test shows which resolver answered. It should be the one you chose or your VPN’s.
If you also use a VPN, check for IPv6 leaks at the same time. Encrypted DNS over IPv4 doesn’t help if IPv6 traffic skips the tunnel entirely.
Common Problems and Fixes
Most encrypted DNS problems come from networks that expect to see or control your DNS. Here’s what breaks and why.
| Symptom | Likely cause | Fix |
|---|---|---|
| Hotel or airport Wi-Fi login page won’t load | The captive portal relies on hijacking plain DNS | Use fallback mode or briefly turn secure DNS off, log in, then turn it back on |
| Internal company sites stop resolving | Those names only exist on the company’s own DNS | Use Increased Protection with exceptions, or follow IT’s policy |
| Android says “No internet access” | Private DNS hostname typo, or port 853 blocked | Check spelling; switch to Automatic on restrictive networks |
| Secure DNS toggle greyed out in Chrome | Managed device or parental controls | Expected behavior; it’s controlled by policy |
| Firefox DoH turned itself off | Default Protection detected a policy or parental controls | Choose Increased or Max Protection explicitly |
| Your own DoH client gets 505 | The resolver requires HTTP/2 | Use an HTTP/2-capable client |
Real-world tip: on public Wi-Fi, encrypted DNS is one layer of a sensible setup, not the whole thing. Our guide to staying safe on airport Wi-Fi covers the rest.
Frequently Asked Questions
The Bottom Line on Encrypted DNS
DoH and DoT encrypt the same thing with the same strength. DoH hides in web traffic and is hard to block. DoT sits on its own port and is easy to manage. Either one beats plain DNS on any network you don’t control.
Our take: turn on secure DNS in your browser today, then set Private DNS on your Android phone or a profile on your iPhone. That covers the devices that leave the house.
Just remember the resolver now sees what your ISP used to, and the IP addresses you visit stay visible without a VPN.
Next step: pick one resolver from the table above, enable it on your main browser and phone, and run a DNS leak test to confirm the change.
Keep Reading
More articles you might enjoy


