DNS Cache Poisoning Explained
DNS cache poisoning injects a forged answer into a resolver's cache. Until the TTL expires, every user of that resolver receives the attacker's IP instead of yours: no warning, no error, just the wrong destination.
Cache poisoning defenses
| Defense | Layer | Notes |
|---|---|---|
| DNSSEC validation | Answer integrity | Cryptographic proof the answer is authentic |
| Randomized ports and IDs | Query matching | Raises the bar for forged replies (Kaminsky class) |
| Query minimization | Information exposure | QNAME minimization per RFC 7816 |
| Trusted resolvers | Transport | DoH or DoT to resolvers that validate |
How the attack works
- The attacker triggers a lookup for target.com at a vulnerable resolver.
- Before the authoritative server answers, the attacker floods the resolver with forged responses.
- If a forged response matches the query (correct transaction ID, source port, and question), the resolver accepts and caches it.
- Every subsequent user of that resolver gets the attacker’s IP for target.com until the TTL expires.
The Kaminsky vulnerability (2008)
Dan Kaminsky demonstrated that by querying random subdomains (a1.target.com, a2.target.com...) an attacker could generate enough guessing attempts to reliably poison the parent domain’s cache. The industry response was source port randomization (16 extra bits of entropy) and the acceleration of DNSSEC deployment.
The defenses, ranked
- DNSSEC: cryptographically signs answers, making forgery detectable regardless of guessing.
- Source port randomization: makes blind spoofing exponentially harder (already standard).
- 0x20 encoding: randomizes query case for additional entropy.
- DoH/DoT: encrypts queries, preventing on-path injection entirely.
Frequently asked questions
Can cache poisoning happen over HTTPS?+
Not to the DNS resolution itself if you use DoH/DoT. But the resolved connection then depends on TLS for its own protection: both layers together are the full defense.
How do I know if my resolver has been poisoned?+
Compare answers across multiple resolvers with the propagation checker. A single resolver returning a different IP for the same domain is a red flag.
Does my DNS provider protect against poisoning?+
Major providers (Cloudflare, Google, Route 53) implement port randomization and DNSSEC validation. Self-hosted BIND servers need explicit configuration.
What is the difference between poisoning and hijacking?+
Poisoning targets the resolver’s cache (temporary, until TTL). Hijacking changes the authoritative data (persists until fixed). Both redirect traffic.
Can I prevent someone from poisoning my domain specifically?+
DNSSEC is the only complete answer: it makes your zone’s answers cryptographically verifiable so forgeries are rejected.
Is cache poisoning still a threat in 2026?+
Less so against major providers, but self-hosted DNS, IoT devices, and legacy resolvers remain vulnerable. DNSSEC is the belt-and-suspenders answer.
Related DNS Security Guides
Explore related DNS attack vectors and cryptographic defenses:
- DNS Hijacking
- DNS Amplification Attacks
- DNS Tunneling
- DNS Rebinding
- DNSSEC: the cryptographic defense
Related
Last verified: 2026-11-11