DNS over HTTPS (DoH) and DNS over TLS (DoT) both do the same basic job: encrypt the DNS lookups your device makes, so anyone sitting on the network path — other Wi-Fi users, your ISP — can no longer read or tamper with the names you're looking up. DoH hides DNS inside ordinary HTTPS traffic on port 443. DoT instead uses its own dedicated port, 853.
Classic DNS was designed back in the 1980s, encryption nowhere in sight. Every lookup — "what's the address of example.com?" — travels in plain text over UDP or TCP port 53, visible to whoever's watching. Below: how encrypted DNS actually works, what it protects and what it doesn't, and how to switch it on across your operating system and browser.
Why plain DNS is a privacy problem
Because traditional DNS travels unencrypted, anyone who can see your traffic can see the list of domains you visit — and anyone positioned on the path can alter the answers you get back. What does that mean in practice?
- A public Wi-Fi operator, or another user on an open network, can log your lookups.
- An ISP can record, sell or redirect queries, for example sending mistyped domains to an advertising page.
- An attacker on the same network can spoof responses and send you to a fake server.
Encrypted DNS only protects the leg between your device and whichever resolver you've chosen. What that resolver itself can see doesn't change at all.
How DoH and DoT work
DNS over TLS (DoT)
Defined in RFC 7858, DoT simply wraps standard DNS messages inside a TLS connection to the resolver, over TCP port 853. The client checks the resolver's certificate — typically against a hostname like dns.example.com — which is what stops an attacker from impersonating it.
DNS over HTTPS (DoH)
Defined in RFC 8484, DoH takes that same binary DNS message and sends it as the body of an HTTPS request (media type application/dns-message) to a URL called a template, something like https://dns.example.com/dns-query. It rides port 443, same as any website, and can run over HTTP/2 or HTTP/3.
DNS over QUIC (DoQ)
A newer entrant, RFC 9250, carries DNS over QUIC on UDP port 853 instead. Support's growing, but it's still a lot less common than DoH and DoT.
| Plain DNS | DoT | DoH | |
|---|---|---|---|
| Standard | RFC 1035 | RFC 7858 | RFC 8484 |
| Transport and port | UDP/TCP 53 | TCP 853 | TCP 443 (or UDP 443 with HTTP/3) |
| Encrypted | No | Yes | Yes |
| Easy for a network to identify or block | Yes | Yes, by port | Hard; looks like web traffic |
| Typically configured in | OS, router | OS (for example Android, Linux) | Browsers, Windows, Apple profiles |
What encrypted DNS does not do
- It doesn't hide you from the resolver. Whoever runs your DoH or DoT provider still sees every single query — you've just moved your trust from your ISP to them instead. Worth actually reading that provider's logging policy.
- It doesn't hide which sites you connect to. Your ISP still sees the IP addresses you connect to, and, unless the site supports Encrypted Client Hello, the hostname in the TLS handshake (SNI) too.
- It doesn't prove answers are genuine. Encryption only protects the hop to the resolver. DNSSEC is the one that lets the resolver verify records were actually signed by the domain owner. Different problems, and they work well side by side. Check whether a domain is signed with our DNSSEC checker.
- It's not a VPN replacement, and it won't make you anonymous.
Enable encrypted DNS on Windows 11
- Open Settings → Network & internet, then select Ethernet, or Wi-Fi → your network's Hardware properties.
- Next to DNS server assignment, click Edit and choose Manual.
- Turn on IPv4 and enter a resolver that supports DoH, for example
1.1.1.1or8.8.8.8. - Set the encryption option, labelled DNS over HTTPS or Preferred DNS encryption depending on the build, to "On (automatic template)" or "Encrypted only". Repeat for IPv6 if you use it.
Windows only fills in that template automatically for resolvers it already recognises. Want to list them, or add your own? Do it in PowerShell:
Get-DnsClientDohServerAddress
Add-DnsClientDohServerAddress -ServerAddress 198.51.100.53 -DohTemplate https://dns.example.com/dns-query -AllowFallbackToUdp $false -AutoUpgrade $true
Android: Private DNS
Android 9 and later ship with Private DNS built in, using DoT under the hood. Head to Settings → Network & internet → Private DNS (on some phones it's buried under Connections → More connection settings) and pick one of these:
- Automatic: uses DoT with the network's own resolver when it supports it, and falls back to plain DNS otherwise.
- Private DNS provider hostname: enter a hostname, not an IP, such as
one.one.one.oneordns.google. Lookups fail rather than fall back if the server is unreachable.
Recent Android versions can actually use DoH for some well-known providers behind the scenes, but the setting field itself still just takes a hostname. Either way, it applies to Wi-Fi and mobile data alike.
iPhone, iPad and Mac: configuration profiles
Since iOS 14 and macOS 11, Apple devices have supported DoH and DoT system-wide — there's just no simple toggle for it anywhere in Settings. Instead, encrypted DNS gets turned on either by an app using Apple's DNS settings API, or by installing a configuration profile (.mobileconfig) that contains a DNS settings payload:
<key>PayloadType</key>
<string>com.apple.dnsSettings.managed</string>
<key>DNSSettings</key>
<dict>
<key>DNSProtocol</key>
<string>HTTPS</string>
<key>ServerURL</key>
<string>https://dns.example.com/dns-query</string>
</dict>
Plenty of resolver operators publish ready-made profiles you can just grab. On iPhone, download the profile, then install it under Settings → General → VPN & Device Management. On a Mac, open the file and approve it in System Settings, under Profiles or Device Management depending on your macOS version. One caution: only install profiles from sources you actually trust, since they're capable of changing system settings.
Linux with systemd-resolved
systemd-resolved already supports DoT. Just edit /etc/systemd/resolved.conf:
[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com
DNSOverTLS=yes
Then run sudo systemctl restart systemd-resolved and confirm it stuck with resolvectl status — you're looking for +DNSOverTLS in the output.
Browsers: Chrome, Edge and Firefox
Browsers don't need the operating system's cooperation at all — they can run DoH entirely on their own:
- Chrome: Settings → Privacy and security → Security → Use secure DNS. "With your current service provider" upgrades to DoH only if your configured resolver supports it; otherwise pick a provider or enter a custom template URL.
- Edge: Settings → Privacy, search, and services → Security → Use secure DNS, with the same options.
- Firefox: Settings → Privacy & Security → DNS over HTTPS. Choose Default Protection, Increased Protection (falls back to your normal DNS if DoH fails), Max Protection (never falls back) or Off, and pick a provider or custom URL.
Curious what your browser's actually doing? Open about:networking#dns in Firefox (the TRR column shows lookups made over DoH) or chrome://net-internals/#dns in Chrome and Edge.
Testing encrypted DNS from the command line
dig @1.1.1.1 +tls example.com A # DoT, BIND 9.18 or later
dig @1.1.1.1 +https example.com A # DoH, BIND 9.18 or later
curl --doh-url https://1.1.1.1/dns-query https://example.com -I
Compare the answers against our DNS lookup tool. Running a VPN? Also run a WebRTC leak test — encrypted DNS does nothing to stop a browser revealing your address through other channels entirely.
Enterprise networks and parental controls
A lot of networks actually depend on being able to see DNS traffic: companies resolve internal names through split-horizon DNS and block malicious domains, while parental-control or ad-blocking filters often work right at the DNS level on the router. A browser that fires DoH straight off to a public resolver bypasses all of that in one move — internal sites stop resolving, and filters simply stop applying.
- Managed devices: Chrome and Edge honour the
DnsOverHttpsModeandDnsOverHttpsTemplatespolicies, Firefox honoursDNSOverHTTPS, so admins can disable DoH outright or point it at an internal resolver instead. - Canary domain: Firefox checks
use-application-dns.netfirst. If the network's resolver returns no address for it, Firefox won't turn on DoH by default — though a user who enabled it manually themselves is unaffected either way. - Network blocking: DoT's easy enough to block, just cut off port 853. DoH is trickier — it can only be blocked by denying known resolver addresses and hostnames one by one, which never really gets complete coverage.
- Families: plenty of filtering DNS services offer their own DoH and DoT endpoints now, so you can keep a filter running while still encrypting lookups. Configure it per device, or lock down browser settings where you can.
Frequently asked questions
Is DoH better than DoT?
The encryption itself is equivalent either way. DoH is harder for networks to block, simply because it looks like ordinary web traffic; DoT is easier for network administrators to identify and manage on their end. Use whichever one your devices happen to support.
Does encrypted DNS slow down browsing?
Setting up that TLS connection adds a small delay to the very first lookup, but connections get reused after that, so later queries end up roughly as fast as plain DNS. Resolver distance and caching matter a lot more than the encryption itself.
Can my ISP still see which websites I visit?
Partly, yes. It can no longer read your DNS queries, but it still sees the IP addresses you connect to, and, for most sites, the hostname inside the TLS handshake too. A VPN hides both of those from the ISP — it just shifts that visibility over to the VPN provider instead.
Will encrypted DNS fix a DNS leak?
It encrypts the queries themselves, sure, but if they're still heading to your ISP's resolver rather than your VPN's, the ISP can still read them on its end regardless. See our guide to DNS and WebRTC leaks.
评论
分享技巧、提出问题,或说说这个工具对您是否有用。