courses

DNS Security and Privacy

The most trusted, least protected protocol

Every connection you make starts with a DNS lookup. Before your browser can reach pdx.edu, it asks a resolver “what is the IP address for pdx.edu?” — and then it trusts the answer completely. That makes DNS one of the highest-value targets on the Internet, and for most of its history it has been one of the least protected.

Classic DNS (1987) runs over UDP port 53 in plaintext, with no encryption and no authentication. Two consequences follow directly, and — exactly as with email security — they are different problems with different fixes:

  1. No authenticity / integrity — you cannot tell whether an answer is genuine or forged. An attacker who can inject a response can send you to their server instead (DNS spoofing / cache poisoning). The fix is DNSSEC.
  2. No confidentiality — anyone on the path (your ISP, the coffee-shop Wi-Fi, a government) can read every domain you look up, building a complete profile of your browsing, and can block or tamper with answers for censorship. The fix is encrypted DNS transports (DoT, DoH, ODoH).

DNSSEC and encrypted transports are orthogonal — you can have either, both, or neither. DNSSEC proves an answer is real but sends it in the clear; DoT/DoH hide the query but do not, by themselves, prove the answer is authentic. This page focuses on the confidentiality side (the network-security page covers DNSSEC in depth), because that is the part the Week 6 schedule calls out and the part with no other coverage.

The threat: why plaintext DNS is dangerous

  You ──"A? pdx.edu"──▶ Resolver ──▶ ... ──▶ Authoritative server
        UDP/53 cleartext
         ▲
         │  Anyone on this path can:
         ├─ READ it  → know every site you visit (surveillance, ad-profiling)
         ├─ FORGE a reply → cache poisoning, send you to a malicious IP
         └─ DROP/REWRITE it → censorship, captive portals, ISP "helpful" redirects

Integrity: DNSSEC (in brief)

DNSSEC (DNS Security Extensions) adds digital signatures (the cryptography primitive) to DNS records. Each zone signs its records, and a chain of trust runs from the root zone down, so a validating resolver can prove an answer genuinely came from the domain owner and was not altered. This is what stops cache poisoning, and it is the foundation that DANE builds on to pin TLS certificates in DNS.

⚠️ DNSSEC authenticates; it does not encrypt. A DNSSEC-signed answer is still sent in plaintext — anyone on the path still sees which domain you asked about. For privacy you need an encrypted transport, below.

Confidentiality: encrypted DNS transports

These wrap the query/response in encryption so on-path observers cannot read or tamper with it. They differ mainly in what they tunnel through and how hard they are to block.

Transport Spec Port How it looks on the wire
Do53 (classic) RFC 1035 53 (UDP/TCP) Plaintext — fully visible
DoT — DNS over TLS RFC 7858 853 (TCP) TLS, but on a dedicated port → easy to identify and block as a category
DoH — DNS over HTTPS RFC 8484 443 (HTTPS) Indistinguishable from normal web traffic → hard to block without breaking HTTPS
DoQ — DNS over QUIC RFC 9250 853 (UDP) DNS over QUIC; lower latency, encrypted

The remaining privacy gap → Oblivious DoH

DoT and DoH hide your queries from the network, but the resolver itself still sees both your IP address and every domain you ask for — you have simply moved the trust from your ISP to whoever runs the resolver (often a large provider like Cloudflare or Google).

Oblivious DoH (ODoH, RFC 9230) closes that gap with privacy partitioning: it inserts a proxy between you and the resolver, and encrypts the query to the resolver so the proxy cannot read it. The result:

No single party knows both who you are and what you asked — as long as the proxy and target do not collude. This is the same decoupling idea behind Tor and Apple’s iCloud Private Relay.

Worked example: querying DNS three ways

Plain dig (over UDP/53) shows the cleartext baseline:

$ dig +short pdx.edu
131.252.115.86          # this query and answer were visible to everyone on-path

To make the query encrypted, use kdig (from the knot-dnsutils package; modern dig 9.18+ also supports +tls/+https). DNS over TLS to Cloudflare on port 853:

$ kdig -d @1.1.1.1 +tls pdx.edu
;; DEBUG: TLS, handshake completed, ... TLS 1.3
;; TLS session is established.                 ← the lookup is now encrypted
pdx.edu.   3600   IN   A   131.252.115.86

DNS over HTTPS to the same provider (note it rides ordinary https://):

$ kdig -d @https://cloudflare-dns.com/dns-query +https pdx.edu
;; DEBUG: HTTP status: 200
pdx.edu.   3600   IN   A   131.252.115.86

On a systemd-based Linux box you can see and set the system resolver’s encryption mode:

$ resolvectl status | grep -i 'DNS over\|Current DNS'
  +DNSOverTLS=opportunistic                     # is DoT enabled?
$ resolvectl query pdx.edu                      # uses the configured transport

To confirm DNSSEC validation specifically, the ad (Authenticated Data) flag in a response means the resolver validated the signatures:

$ dig +dnssec +short pdx.edu             # request DNSSEC records
$ dig pdx.edu | grep -o 'flags:[^;]*'    # look for the 'ad' flag
flags: qr rd ra ad                       # 'ad' = answer was DNSSEC-validated

Putting it together: defense in depth for DNS

No single mechanism gives you a secure and private lookup:

You want… Use… Because…
The answer is authentic (not poisoned) DNSSEC Signatures + chain of trust
The query is private from the network DoT / DoH Encrypts query to the resolver
The query is private from the resolver too ODoH Splits “who you are” from “what you asked”

The fully-protected lookup combines a DNSSEC-validating resolver reached over an encrypted (and ideally oblivious) transport — integrity and confidentiality, the same dual goal you saw in email security.

Key takeaways

References


Related course pages: Introduction to Networking · Network Security · Email Security · Cryptography · VPNs and IPSec

🛠️ Maintenance note: DoQ (RFC 9250) and ODoH (RFC 9230) are relatively recent and client support is still maturing — re-verify kdig/resolvectl flag support against the course VM each term. The DoH-vs-enterprise-visibility debate and browser defaults (Firefox/Chrome auto-DoH rollout) continue to shift; refresh that framing yearly.