DNS Spoofing and Cache Poisoning: How They Work and What Stops Them

DNS spoofing doesn't require intercepting real traffic. It requires guessing correctly, and arriving first — a resolver's cache accepts whichever response gets there before the genuine one.

What DNS Spoofing Is

DNS spoofing forges a DNS response so that a resolver caches and serves an attacker-chosen IP address instead of the real one. Once a forged answer is cached, every client using that resolver receives it until the TTL expires — no further attacker action needed.

A cache-poisoning raceID + portforged answersClientResolverAuthoritative serverreal answerAttackerforged answers
The attacker must guess the query ID and port and answer before the real server does; DNSSEC makes a forged answer fail validation.

The Off-Path Problem

An attacker who isn't sitting on the network path between the resolver and the real authoritative server can't simply read or edit the genuine traffic. Instead, the forged response has to be guessed and delivered before the real authoritative answer arrives — a race, not an interception.

What Has to Be Guessed

A resolver identifies a valid reply by a 16-bit transaction ID and the UDP source port the query was sent from. The 2008 Kaminsky attack showed how to turn a low-probability single guess into a practical attack: tricking a resolver into looking up many different, nonexistent subdomains of the same domain gives an attacker many independent races to win the same cache slot, since any one successful forgery poisons the parent domain's records.

The Impact of a Successful Poisoning

Once poisoned, the resolver silently redirects every client that queries it — to a phishing site, an ad-injection point, anything the attacker chose — without touching a single one of the victims' own systems, for as long as the forged record's TTL lasts.

Why DNSSEC Stops This

A validating resolver checks a cryptographic signature chain back to a trusted root before accepting a response. An attacker who successfully wins the guessing race still doesn't hold the zone's private signing key, so the forged response can't produce a valid signature — correct transaction ID and port guesses become irrelevant once validation itself is the thing checking authenticity.

Check DNSSEC for a Domain

Frequently asked questions

What is the difference between DNS spoofing and DNS cache poisoning?

The terms are largely used interchangeably — spoofing describes forging the response, cache poisoning describes the result of a forged response being accepted and stored. A successful spoof is what causes the poisoning.

Does DNSSEC encrypt my DNS traffic to prevent spoofing?

No. DNSSEC authenticates responses with cryptographic signatures; it doesn't encrypt them. A forged response can't pass signature validation even though it — like every other DNS response — is still sent in plaintext.

Is my resolver vulnerable to cache poisoning?

A resolver that properly randomizes both the transaction ID and the UDP source port on every query is far harder to spoof than one that doesn't — but the only defense that removes the guessing race entirely is validating DNSSEC signatures on the answers it accepts.

Try it on your domain

See the theory in practice — run a DNSSEC Check for your own domain.