DoH vs DoT — comparing DNS over HTTPS and DNS over TLS in 2025
DNS over HTTPS (DoH) and DNS over TLS (DoT) both wrap classic DNS in TLS so the queries cannot be read or rewritten by anything in the middle. They look similar from a privacy standpoint, but the transport choices behind each one have meaningful operational consequences. This article covers what each protocol is, how they differ, and when to pick one over the other.
What each standard actually says
DNS over TLS is defined by RFC 7858. It runs DNS messages — the same wire format as classic UDP/53 — inside a TLS 1.2+ connection on TCP port 853. Each query carries a 2-byte length prefix and the rest of the packet is unchanged from RFC 1035.
DNS over HTTPS is defined by RFC 8484. It carries DNS messages as the body of an HTTP request or response, using application/dns-message as the content type and port 443. Because it is HTTP, DoH inherits HTTP/2 stream multiplexing, HTTP/3 / QUIC, caching headers, and any middleware your edge stack already understands.
"DoH provides a means for DNS resolution that uses HTTPS as a transport... mitigating the threat of on-path observation and modification." — RFC 8484 §1
Wire-level comparison
| Property | DoH (RFC 8484) | DoT (RFC 7858) |
|---|---|---|
| Transport | HTTP/2 or HTTP/3 over TLS | TLS over TCP |
| Default port | 443 | 853 |
| Wire format | DNS message wrapped in HTTP | Length-prefixed DNS message |
| Connection reuse | Multiplexed via HTTP streams | One stream per TCP connection |
| Indistinguishable from web traffic | Yes | No (dedicated port) |
| Easy to host on a CDN | Yes | No |
| Overhead per query | Slightly higher (HTTP headers) | Slightly lower |
You can probe both with kdig from the knot-dnsutils package:
kdig @1.1.1.1 +tls-ca example.com
kdig @cloudflare-dns.com +https example.com
Deployment trade-offs
DoH is the easier protocol to ship in a browser or a mobile app, because the runtime already speaks HTTPS. Firefox, Chrome and the various OS-level resolver opt-ins all default to DoH. It is also the easier protocol to deliver from a CDN — SecDNS, for example, serves DoH from the same anycast edge as the rest of the product.
DoT is the easier protocol to operate on a constrained device. Routers, smart TVs, IoT gateways and embedded Linux distributions ship with TLS but rarely with a full HTTP/2 stack, and a dedicated port simplifies firewall rules. DoT is also the default on Android 9+ (Private DNS), which is why router vendors typically expose a DoT hostname before they expose a DoH URL.
Operational and policy concerns
Network admins often have stronger feelings about DoH than DoT, because DoH on port 443 looks identical to web traffic and bypasses the corporate resolver unless the operating system honours the new Discovery of Designated Resolvers (DDR) mechanism. DoT runs on a unique port and can be allowed, blocked, or steered with a single firewall rule. Both are equally encrypted; the policy story is what differs.
From a protective-DNS standpoint (covered in What is protective DNS?), both transports preserve the resolver's ability to enforce filtering, log queries and validate DNSSEC. The decision is mostly about which transport the endpoint can speak comfortably.
Choosing a default
A reasonable rule of thumb:
- Use DoH when the client is a browser, a phone or an application you control and you want CDN-friendly delivery.
- Use DoT when the client is a router or embedded device, or when you want the admin team to be able to govern encrypted DNS with simple firewall rules.
- Offer both if you operate the resolver. SecDNS exposes a DoH URL and a DoT hostname per profile so devices can pick whichever they speak natively.
Further reading
- Glossary: DoH, DoT, DNS, protective DNS
- Features: DNS over HTTPS, DNS over TLS
- Learn: DNS basics, How DNS works in depth, What is protective DNS?