Skip to content
← DNS: the internet’s address book

Lesson 3 of 4 · 7 min

Encrypted DNS: DoH and DoT

Two standards wrap DNS lookups in encryption. What that actually hides, what it still does not, and how macOS supports it.

The previous lesson described a plain DNS lookup as a postcard: readable by anyone handling it along the way. Two IETF standards exist to put that postcard in an envelope: DNS over TLS (DoT, RFC 7858) and DNS over HTTPS (DoH, RFC 8484). Both encrypt the same lookup; they differ mainly in how they carry it.

DNS over TLS

RFC 7858 states its goal directly: “encryption provided by TLS eliminates opportunities for eavesdropping and on-path tampering with DNS queries”, addressing the fact that “nearly all DNS queries are sent unencrypted, which makes them vulnerable to eavesdropping by an attacker.” DoT uses its own dedicated port, 853, rather than the usual port 53. The RFC explains why: “this recommendation against use of port 53 for DNS over TLS is to avoid complication in selecting use or non-use of TLS and to reduce risk of downgrade attacks.”

DNS over HTTPS

RFC 8484 takes a different route: “each DNS query-response pair is mapped into an HTTP exchange”, carried over the same port 443 that ordinary HTTPS traffic uses. The RFC notes this has a side benefit: “the HTTPS default port 443 and the ability to mix DoH traffic with other HTTPS traffic on the same connection can deter unprivileged on-path devices from interfering with DNS operations”, because a lookup is harder to single out and block when it looks like any other web request.

Source: Cloudflare Learning, DNS over TLS vs. DNS over HTTPS.
DNS over TLS (DoT)DNS over HTTPS (DoH)
Port853, dedicated to DoT443, shared with ordinary HTTPS traffic
Visible on the network asIts own distinct traffic (easy to spot and, if a network chooses to, block)Blended in with normal web browsing

What encryption hides, and what it still does not

Both standards stop a network operator or Wi-Fi eavesdropper from reading your lookups in transit. Neither hides them from the resolver you sent them to. RFC 8484 is explicit that DoH does not change who the server itself can see: it notes that “various transports of DNS queries and responses do provide data that can be used to correlate requests”, and that ordinary web mechanics such as client IP addresses, cookies and TLS session information mean “DoH is not known to introduce new concerns beyond those associated with HTTPS” at the server end. RFC 7858 similarly notes DoT “does not address other security issues in DNS” and that “even with encrypted messages, a well-positioned party may be able to glean certain details from an analysis of message timings and sizes.” In short: encrypted DNS moves who sees your lookups back to the resolver operator you chose, it does not remove visibility altogether.

There is a second gap worth knowing about. Encrypting the DNS lookup does not by itself hide which site you then connect to: the TLS handshake that follows normally includes the hostname in plain view. As Cloudflare’s explanation of Server Name Indication (SNI) puts it, “SNI includes the hostname in the Client Hello message, or the very first step of a TLS handshake” — sent before encryption is established. An extension called Encrypted SNI (ESNI), the same source explains, “adds on to the SNI extension by encrypting the SNI part of the Client Hello”, which “prevents anyone snooping between the client and server from being able to see which certificate the client is requesting.” Support for hiding SNI still depends on both the browser and the site agreeing to it, and is not yet how every connection works.

How macOS supports it

Apple documents a DNS Settings configuration for Mac, iPhone and iPad that does exactly this: it lets a device “route a device’s DNS queries through an encrypted DNS server using DNS over HTTPS or DNS over TLS.” It is delivered as a configuration profile, which can restrict the encrypted resolver to specific domains through “supplemental match domains”, or apply only on certain networks using “on-demand rules” that can match things like the network’s SSID.

Key takeaways

  • DoT (RFC 7858) encrypts DNS with TLS on a dedicated port, 853; DoH (RFC 8484) encrypts it and carries it over HTTPS’s usual port, 443, blending in with other web traffic.
  • Both stop eavesdroppers on the network path from reading your lookups.
  • Neither hides your lookups from the resolver you sent them to: RFC 8484 itself says DoH is "not known to introduce new concerns beyond those associated with HTTPS" at the server end.
  • Even with encrypted DNS, the TLS handshake for the site itself normally reveals its hostname in plain view (SNI), unless an extension such as Encrypted SNI is used.
  • macOS and iOS support encrypted DNS through a documented DNS Settings configuration profile, which can specify DoH or DoT and scope it to certain domains or networks.

Check yourself

  1. 1. What port does DNS over TLS (DoT) use, and why a dedicated one?

    • Port 80, the same as HTTP
    • Port 853, chosen partly to avoid downgrade attacks that could come from ambiguity on port 53 — Right.
    • Port 25, the same as email
    • Any random port each time

    RFC 7858 assigns DoT its own port, 853, explaining that avoiding port 53 for it "reduce[s] risk of downgrade attacks."

  2. 2. Why does DNS over HTTPS (DoH) use port 443?

    • Because it is the only free port
    • Because sharing port 443 with ordinary HTTPS traffic makes DoH harder to single out and block — Right.
    • Because port 443 is faster than other ports
    • DoH does not use port 443

    RFC 8484 notes that mixing DoH with regular HTTPS traffic on port 443 "can deter unprivileged on-path devices from interfering with DNS operations."

  3. 3. Does DoH or DoT hide your DNS lookups from the resolver you send them to?

    • Yes, completely
    • No, they hide lookups from the network path, but the resolver operator still sees the queries — Right.
    • Only DoH hides them from the resolver
    • Only DoT hides them from the resolver

    RFC 8484 states DoH is "not known to introduce new concerns beyond those associated with HTTPS" at the server end, meaning the resolver operator remains able to see and correlate queries.

  4. 4. Even with encrypted DNS, what commonly still reveals which site you are connecting to?

    • The Wi-Fi password
    • The hostname sent in plain view in the TLS Client Hello (SNI), unless an extension like Encrypted SNI is used — Right.
    • Your Mac’s private IP address
    • The DNS resolver’s cache

    Cloudflare explains that "SNI includes the hostname in the Client Hello message" before encryption begins; Encrypted SNI (ESNI) is designed to hide it, but is not yet universal.

Do it with FireAI

Put this lesson into practice on your own Mac.

Sources

Put it into practice on your Mac

Try every feature free for 17 days, no card needed.

Download for Mac Docs