Loading learning content...
Every website you visit begins with a DNS query—a plaintext request transmitted over UDP port 53 that reveals exactly which domains you're accessing. Your ISP sees every query. Network operators at cafes, hotels, and airports see every query. Governments conducting surveillance see every query. Even with HTTPS encrypting your actual web traffic, DNS queries create a detailed log of your internet activity.
DNS over HTTPS (DoH) fundamentally changes this dynamic by wrapping DNS queries inside encrypted HTTPS connections. To network observers, DoH traffic is indistinguishable from regular HTTPS web traffic—just another connection to a server on port 443. This provides genuine privacy for DNS resolution while also bypassing network-level DNS manipulation and censorship.
By the end of this page, you will understand: (1) Why DNS privacy matters in the modern internet, (2) How DoH encapsulates DNS queries within HTTPS, (3) The wire format and message encoding for DoH, (4) Resolver discovery and configuration mechanisms, (5) Performance implications including connection reuse and latency, (6) The controversy around centralization and enterprise control, and (7) How DoH interacts with DNSSEC for complete security.
To understand why DoH exists, we must first understand the privacy and security implications of unencrypted DNS. Traditional DNS (RFC 1035) was designed for a cooperative, academic network where privacy was not a concern. Today's internet reality is fundamentally different.
What traditional DNS exposes:
| Observer | Access Method | Typical Use | Privacy Impact |
|---|---|---|---|
| ISP | Operates resolver; sees all queries | Analytics, advertising, compliance | Complete browsing history visible |
| Network Operator | Packet inspection on local network | Security monitoring, content filtering | All local users' queries exposed |
| On-path Attacker | ARP spoofing, WiFi eavesdropping | Surveillance, credential theft preparation | Targeted observation of individuals |
| Government/LEO | Taps at ISP, IXP, or international links | Surveillance, censorship enforcement | Mass population monitoring |
| DNS Provider | Receives queries as resolver operator | Threat intelligence, product improvement | Centralized query database |
Beyond privacy—integrity concerns:
Unencrypted DNS also enables manipulation:
While some manipulation is benign or even desired (enterprise security), the mechanism enables both legitimate uses and abuse. DoH shifts control from network operators to users.
Encrypting DNS alone doesn't fully hide site visits. The TLS handshake's Server Name Indication (SNI) field remains visible (in TLS 1.2 and unencrypted SNI in TLS 1.3). Encrypted Client Hello (ECH) is an emerging standard to address this. Complete browsing privacy requires: encrypted DNS (DoH/DoT) + Encrypted Client Hello + HTTPS content encryption.
DNS over HTTPS (RFC 8484) encapsulates DNS messages within HTTPS requests and responses. Unlike traditional DNS which uses its own UDP/TCP-based transport, DoH leverages the existing web infrastructure—TLS encryption, HTTP/2 multiplexing, and standard web server technology.
Core design principles:
URI Template and Content Types:
DoH servers expose an endpoint (typically /dns-query) that accepts DNS queries. The RFC specifies:
application/dns-message — The body contains raw DNS wire formatapplication/dns-message responseshttps://dns.example.com/dns-query{?dns})GET vs POST methods:
dns parameter; cacheable by HTTP intermediaries; limited by URL lengthHTTP/2 advantages:
DoH strongly benefits from HTTP/2 features:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
# DoH GET Request (query encoded in URL)# Query: www.example.com A record# Base64url encoding of DNS wire format query GET /dns-query?dns=AAABAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB HTTP/2Host: dns.cloudflare.comAccept: application/dns-message # ResponseHTTP/2 200 OKContent-Type: application/dns-messageCache-Control: max-age=300Content-Length: 64 [Binary DNS response - 64 bytes] --- # DoH POST Request (query in body) POST /dns-query HTTP/2Host: dns.googleContent-Type: application/dns-messageAccept: application/dns-messageContent-Length: 41 [Binary DNS query - 41 bytes] # Response (same format as GET)HTTP/2 200 OKContent-Type: application/dns-messageCache-Control: max-age=86400 [Binary DNS response] --- # DNS Wire Format (hex dump of query)# Transaction ID: 0xABCD# Flags: 0x0100 (standard query, recursion desired)# Questions: 1# Query: www.example.com IN A ABCD 0100 0001 0000 0000 00000377 7777 0765 7861 6D70 6C65 0363 6F6D 000001 0001 # \x03www\x07example\x03com\x00 = www.example.com# \x00\x01 = Type A# \x00\x01 = Class INDoH GET requests use base64url encoding (RFC 4648 §5)—standard base64 with '+' replaced by '-', '/' replaced by '_', and padding removed. This makes DNS queries URL-safe without requiring percent-encoding. Example: standard base64 'A+B/C==' becomes base64url 'A-B_C'.
One of DoH's practical challenges is resolver discovery—how does a client know which DoH server to use? Traditional DNS resolvers are discovered automatically via DHCP. DoH requires explicit configuration or discovery mechanisms.
Current configuration methods:
The DDR protocol:
Discovery of Designated Resolvers enables automatic DoH/DoT upgrade. Clients query a special DNS record type (SVCB/HTTPS) to discover encrypted resolver endpoints:
_dns.resolver.arpa SVCB record| Provider | Endpoint URL | Features | Privacy Policy |
|---|---|---|---|
| Cloudflare | https://cloudflare-dns.com/dns-query | 1.1.1.1, malware/adult filtering options | No logging of IP; 24-hour query logs deleted |
https://dns.google/dns-query | 8.8.8.8, EDNS Client Subnet support | Anonymized logs; some data retained | |
| Quad9 | https://dns.quad9.net/dns-query | 9.9.9.9, threat blocking, no EDNS-CS | No IP logging; Swiss jurisdiction |
| NextDNS | https://dns.nextdns.io/ | Customizable filtering, analytics | User-controlled logging policy |
| AdGuard | https://dns.adguard.com/dns-query | Ad/tracker blocking built-in | Optional logging; various policies |
| Mullvad | https://dns.mullvad.net/dns-query | VPN provider, ad blocking | No logging; Sweden jurisdiction |
Browser behavior and fallback:
Modern browsers implement DoH with careful fallback behavior:
Firefox:
Chrome/Edge:
Safari/iOS:
1234567891011121314151617181920212223242526272829303132333435
; Discovery of Designated Resolvers (DDR); RFC 9462 - Automatic encrypted resolver upgrade ; Step 1: Query special discovery name via traditional DNS; Client queries _dns.resolver.arpa for SVCB records $ dig _dns.resolver.arpa SVCB @192.168.1.1 ; Response contains encrypted resolver information:_dns.resolver.arpa. 7200 IN SVCB 1 dns.example.net. ( alpn=h2,h3 dohpath=/dns-query{?dns} ipv4hint=203.0.113.1 ipv6hint=2001:db8::1) ; Interpretation:; - Priority 1 (most preferred); - Target: dns.example.net; - Supports HTTP/2 (h2) and HTTP/3 (h3); - DoH path: /dns-query{?dns}; - IP hints for connection establishment ; Step 2: Client connects to https://dns.example.net/dns-query; Step 3: Verifies TLS certificate for dns.example.net; Step 4: Uses DoH for subsequent queries ; Alternative: DNS over TLS (DoT) discovery_dns.resolver.arpa. 7200 IN SVCB 2 dns.example.net. ( alpn=dot port=853 ipv4hint=203.0.113.1) ; This enables upgrade to DoT on port 853Browsers detect enterprise networks to avoid breaking internal DNS resolution. Firefox checks for a canary domain (use-application-dns.net); if it resolves to a specific IP, DoH is disabled. This allows enterprises to opt out of DoH network-wide. Chrome respects system DNS configuration and doesn't change resolver, only transport.
A common concern with DoH is performance overhead—TLS handshakes and HTTP framing add latency compared to raw UDP. However, real-world performance is more nuanced, and DoH can actually improve resolution times in some scenarios.
Latency components:
Traditional DNS (UDP):
DoH (initial connection):
DoH (subsequent queries, same connection):
| Factor | Impact | Mitigation Strategy |
|---|---|---|
| TLS Handshake | +2 RTT for initial connection | Connection pooling; TLS session resumption; 0-RTT |
| HTTP Framing | ~20-50 bytes overhead per query | HTTP/2 HPACK compression reduces overhead |
| Connection Reuse | Amortizes setup cost across queries | Keep-alive connections; browser connection pooling |
| Geographic Distance | DoH resolvers may be farther than local ISP DNS | CDN-hosted resolvers; anycast deployment |
| TCP vs UDP | TCP requires connection state; more robust | Persistent connections eliminate per-query overhead |
| HTTP/3 (QUIC) | 0-RTT connection restoration; better loss handling | Emerging deployment; reduces initial latency |
When DoH is faster:
Surprisingly, DoH can outperform traditional DNS in several scenarios:
Unreliable networks — TCP's reliability prevents the need for application-layer retries common with UDP DNS
Multiple queries — HTTP/2 multiplexing sends many queries simultaneously; traditional DNS serializes queries
Well-connected resolvers — Cloudflare/Google have extensive PoP networks; your ISP's resolver may be farther
TLS 1.3 session resumption — Pre-shared keys enable 1-RTT connections (0-RTT with early data)
Connection warming — Browsers proactively establish DoH connections during idle time
Performance optimization strategies:
Use curl --doh-url https://dns.cloudflare.com/dns-query https://example.com to test DoH integration. Browser DevTools show DNS resolution timing in the Network panel. For detailed benchmarking, DNSPerf.com tracks resolver performance globally.
DoH has been controversial within the internet governance community. While proponents emphasize privacy benefits, critics raise concerns about DNS centralization and the shifting power dynamics in internet infrastructure.
The centralization argument:
Traditional DNS resolution is distributed by design—thousands of ISPs operate resolvers, and users typically use their ISP's resolver automatically. DoH, by enabling easy resolver switching and requiring explicit configuration, tends to concentrate queries on a few large providers:
This concentration creates new points of control, surveillance potential, and single points of failure.
| Aspect | Distributed (ISP) Model | Centralized (DoH Provider) Model |
|---|---|---|
| Privacy from ISP | ISP sees all queries | ISP sees only that you use DoH |
| Privacy from Resolver | ISP sees all queries | DoH provider sees all queries |
| Censorship Resistance | ISP can easily block/manipulate | Harder to block (looks like HTTPS) |
| Failure Impact | Local outage affects local users | Provider outage affects global users |
| Regulatory Jurisdiction | Local law applies to local ISP | Provider jurisdiction may differ from user |
| Enterprise Control | Network admin controls resolver | Users can bypass enterprise DNS |
| Logging/Analytics | Distributed across many ISPs | Concentrated in few providers |
Enterprise and network operator concerns:
Network administrators have expressed significant concerns about DoH bypassing their visibility and control:
Security monitoring — Enterprise security often relies on DNS logging to detect malware, C2 communication, and data exfiltration. DoH bypasses these controls.
Content filtering — Schools, libraries, and workplaces use DNS for content filtering. DoH allows users to circumvent these policies.
Split-horizon DNS — Enterprises often have internal DNS zones (e.g., intranet.company.com) that external DoH resolvers cannot resolve.
Incident response — DNS logs are crucial forensic evidence. DoH to external resolvers eliminates this visibility.
Regulatory compliance — Some industries require logging of all internet activity; DoH complicates compliance.
The balanced perspective:
Both sides have legitimate concerns:
DoH represents a fundamental shift in who controls DNS resolution—from network operators (ISPs, enterprises) to endpoint users and their chosen software vendors. Whether this is positive depends on your trust model: do you trust your ISP or your browser vendor more? Neither answer is universally correct.
DoH and DNSSEC are complementary technologies that together address different DNS security needs. Understanding their relationship is essential for implementing comprehensive DNS security.
What each provides:
| Security Property | DNSSEC | DoH |
|---|---|---|
| Authenticity | ✅ Cryptographic proof of record origin | ❌ Trusts resolver's response |
| Integrity | ✅ Detects any record modification | ⚠️ Only between client and resolver |
| Confidentiality | ❌ Queries and responses in plaintext | ✅ All content encrypted |
| Availability | ❌ Can be blocked at network level | ⚠️ Harder to block (port 443) |
The complete security model:
To achieve full DNS security, combine both technologies:
Implementation considerations:
Where should DNSSEC validation happen?
At the resolver (common): The DoH resolver performs DNSSEC validation and returns an "AD" (Authenticated Data) flag if verified. Client trusts this flag.
At the client (more secure): Client performs its own DNSSEC validation after receiving response. Doesn't trust resolver's AD flag. Requires DNSSEC-validating stub resolver.
DoH resolvers and DNSSEC:
Most major DoH providers perform DNSSEC validation:
123456789101112131415161718192021222324252627282930313233
// DoH JSON response format (RFC 8484 alternative)// Includes DNSSEC validation status // Request: https://dns.google/resolve?name=example.com&type=A&do=true { "Status": 0, // NOERROR "TC": false, // Not truncated "RD": true, // Recursion desired "RA": true, // Recursion available "AD": true, // ✓ Authenticated Data (DNSSEC validated) "CD": false, // Checking Disabled not set "Question": [ { "name": "example.com", "type": 1 } ], "Answer": [ { "name": "example.com", "type": 1, "TTL": 3600, "data": "93.184.216.34" } ], "Comment": "Response from 199.43.135.53"} // Key fields for DNSSEC:// AD=true: Response was DNSSEC-validated by resolver// CD=true: Client requested DNSSEC checking disabled// Status=2 (SERVFAIL): Often indicates DNSSEC validation failureFor maximum security: Use DoH with a trusted resolver that performs DNSSEC validation. If you don't fully trust your DoH provider, run a local DNSSEC-validating resolver (like Unbound) that uses DoH upstream. This gives you encrypted transport AND independent validation.
Deploying DoH ranges from simple browser configuration to enterprise-scale infrastructure. Understanding deployment options helps choose the right approach for your needs.
Client-side deployment options:
123456789101112131415161718192021222324252627282930313233
# Local DoH resolver using cloudflared# Proxies local DNS to Cloudflare DoH # Installation (Linux)$ wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64$ sudo mv cloudflared-linux-amd64 /usr/local/bin/cloudflared$ sudo chmod +x /usr/local/bin/cloudflared # Run as DNS proxy$ cloudflared proxy-dns --port 5053 --upstream https://cloudflare-dns.com/dns-query # Configure system to use local resolver$ echo "nameserver 127.0.0.1" | sudo tee /etc/resolv.conf --- # Alternative: curl for DoH testing# Query example.com A record via DoH $ curl -H 'accept: application/dns-json' \ 'https://cloudflare-dns.com/dns-query?name=example.com&type=A' # Response:# {"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,# "CD":false,"Question":[{"name":"example.com","type":1}],# "Answer":[{"name":"example.com","type":1,"TTL":3600,"data":"93.184.216.34"}]} --- # Windows 11 DoH via PowerShellAdd-DnsClientDohServerAddress -ServerAddress 1.1.1.1 \ -DohTemplate https://cloudflare-dns.com/dns-query \ -AutoUpgrade $TrueServer-side / Enterprise deployment:
Organizations may want to deploy their own DoH servers to maintain control while providing encryption:
Internal DoH resolver — Run a DoH-enabled resolver (dnsdist, CoreDNS, nginx with dns-over-https module) internally. Clients configured to use internal DoH endpoint.
Split DNS with DoH — Internal resolver handles internal zones; forwards external queries to upstream DoH resolver.
DoH with logging — Deploy DoH internally but maintain DNS logging for security/compliance. Encryption protects from external observers, not internal.
DDR publishing — Publish SVCB records for resolver.arpa to enable automatic client upgrade to your DoH/DoT server.
Blocking DoH (network perspective):
Some networks legitimately need to prevent DoH bypass:
Blocking DoH is fundamentally difficult. DoH uses the same port and protocol as regular HTTPS. Without TLS inspection (which breaks end-to-end encryption), distinguishing DoH from web traffic requires IP-level blocking. As DoH providers expand their anycast networks and CDN deployments, IP blocking becomes impractical.
DNS over HTTPS represents a fundamental shift in DNS architecture—from an unencrypted, network-operator-controlled service to an encrypted, user-controlled one. This shift has significant implications for privacy, security, and internet governance.
Let's consolidate the key concepts:
What's next:
DoH isn't the only encrypted DNS protocol. The next page examines DNS over TLS (DoT)—an alternative that uses dedicated port 853 for encrypted DNS. We'll compare DoH and DoT, understanding when each is appropriate and how they differ in privacy, performance, and deployability.
You now understand DNS over HTTPS: how it encrypts DNS queries within HTTPS, its privacy benefits, performance characteristics, and the centralization debate it has sparked. Combined with DNSSEC knowledge from the previous page, you can evaluate encrypted DNS deployment options. Next, we'll examine DNS over TLS as an alternative approach.