Lesson 14 of 18 · 22m
DNS Security: Poisoning, DNSSEC, and the Encrypted-Path Wars
Cache poisoning is a guessing game the resolver must make unwinnable; DNSSEC signs instead of encrypts; DoH hides lookups from the network policing them.
In July 2008, Dan Kaminsky told DNS vendors — privately — that the query protocol could be poisoned in seconds, and every major resolver shipped the same emergency patch on the same day (CERT VU#800113, July 8, 2008). The bug wasn't a software flaw. It was a design assumption: TXIDs were 16-bit random, source ports were fixed, and an attacker who guessed both got to be the authoritative answer. That class of bug never went away; it moved.
How cache poisoning works
A recursive resolver asks ns1.example.com for www.example.com and waits for the first valid reply. A forgery only needs to arrive first and match: ports, TXID, question name. Kaminsky's amplification was the bailiwick trick — query for aaa1234.example.com, which cannot be in cache, and flood forged responses claiming authority for example.com glue. Every cache miss is a fresh lottery ticket, and the birthday paradox makes 16 bits a bad bet within hundreds of tries. Win once and the poisoned record lives for its TTL.
The defense was never a better TXID — it's entropy stacking. Random TXID + randomized source port + 0x20 case encoding (WwW.eXaMpLe.CoM, echoed back with matching capitalization) pushes the guess space past practical reach for an off-path attacker. Cache safety comes from matching difficulty, not correctness checks.
DNSSEC: signing the answer, not encrypting it
DNSSEC adds a signature chain: zones sign records (RRSIG) with zone keys (DNSKEY); parents sign those keys upward (DS) to the root everyone trusts. A validating resolver — Quad9 (9.9.9.9), Cloudflare (1.1.1.1), Google (8.8.8.8) all validate — detects forgery cryptographically; no guessing involved.
The cost is operational and binary. Signatures expire; keys rotate; a bad RRSIG doesn't fail open, it SERVFAILs — the domain goes dark. Expired signatures and botched rollovers have caused multi-hour outages at major domains; the postmortems on dnssec-deployment lists are required reading. Sign when you can keep signatures fresh, not because signing sounds safer.
The encrypted-path fight
DoT (port 853), DoH (443), and DoQ encrypt the stub-to-recursive hop. DoH is the contentious one: it looks like ordinary HTTPS, so it bypasses DNS-based controls — Firefox enabled it by default for US users in February 2020, which means the network no longer sees the lookups it exists to police. Privacy win for the user, blind spot for the defender, and a documented malware C2/exfil channel. The sane enterprise posture is running your own DoH endpoint and pointing clients at it — clients will use someone's resolver either way.
DNS as a weapon
- Amplification. Small UDP query, large signed answer — DNSSEC's big RRSIG/DNSKEY replies made resolvers better amplifiers, and open resolvers remain DDoS infrastructure. Never run an open recursive resolver.
ANYqueries were abused so hard that RFC 8482 blessed minimal responses. - Rebinding. An answer that resolves publicly, then to
127.0.0.1or10.xon re-resolution, is a TOCTOU primitive against server-side fetchers — browsers pin hostnames to blunt it; SSRF targets re-resolve and get the internal IP. Resolve-and-pin, or deny private ranges in the fetch layer. - ECS leak. EDNS Client Subnet ships your client prefix to authoritative servers so CDNs pick a closer node — a tracking vector baked into the query path.
Try this
dig +dnssec example.com # RRSIGs attached
dig example.com @9.9.9.9 # ad flag = validated
delv @9.9.9.9 example.com # validation trace (bind9)
dig chaos txt whoami.cloudflare @1.1.1.1 # your egress identityField notes
- Your libc stub does no DNSSEC validation; validation lives at the recursive layer — systemd-resolved ships DNSSEC off or
allow-downgradedepending on the build. - TTL is a security knob: short TTLs shrink poisoning windows but raise query volume; a long TTL turns one bad record into a day-long incident.
- Split-horizon DNS — internal answers on internal resolvers — remains the correct design. Internal names in public zones are recon data you published yourself.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
What is a Web Server? Apache, Nginx, and How the Internet Delivers Web Pages
A web server accepts HTTP requests and returns responses. Apache has been doing this since 1995. Nginx rebuilt the model in 2004 and took over the cloud. Here's how they work, how they differ, and how to pick between them.
How to Install NGINX on Debian & Ubuntu: Server Blocks, HTTPS and Reverse Proxy
When it comes to running a web server for all of my online projects, NGINX is the first that comes to mind for me. By default, it follows my guidelines of running a piece of software – meaning that the software is security-minded, performance-driven, and honestly, really easy to manage all the aspects of it. NGINX is most likely the most popular web server software in the world, and it's well known for being the backbone of some of the biggest sites on the internet to date. It is a lightweight
Minecraft 26.4 Replaced Its Decade-Old Login Crypto. Here's What key-rotation-period-seconds Actually Does.
26.4 Snapshot 9 rewrote how a Java Edition client and server agree on an encryption key. RSA-1024 is out, X25519 is in, and a new key-rotation-period-seconds setting decides how often the server's key changes. I opened the snapshot server jar, timed the login crypto, and checked what changes for...
The Same Researcher Broke apt the Same Way Twice, Seven Years Apart
In 2019 Max Justicz showed apt would install a package an attacker swapped in over a redirect. In November 2026 he did it again, CVE-2026-109518, through a different door that ends in the same place: code as root from a man in the middle. The fix shows how apt reuses files on disk.