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

DefenseLayerNotes
DNSSEC validationAnswer integrityCryptographic proof the answer is authentic
Randomized ports and IDsQuery matchingRaises the bar for forged replies (Kaminsky class)
Query minimizationInformation exposureQNAME minimization per RFC 7816
Trusted resolversTransportDoH or DoT to resolvers that validate
Browser Resolver Root+TLD Authoritative Website query solid = query · dashed = cached response · every hop caches until TTL
The resolution path that cache poisoning targets

How the attack works

  1. The attacker triggers a lookup for target.com at a vulnerable resolver.
  2. Before the authoritative server answers, the attacker floods the resolver with forged responses.
  3. If a forged response matches the query (correct transaction ID, source port, and question), the resolver accepts and caches it.
  4. 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

  1. DNSSEC: cryptographically signs answers, making forgery detectable regardless of guessing.
  2. Source port randomization: makes blind spoofing exponentially harder (already standard).
  3. 0x20 encoding: randomizes query case for additional entropy.
  4. 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:

Last verified: 2026-11-11