Use this when a resolver may hold forged records that redirect all its clients.
DNS Cache Poisoning
1. Cache poisoning injects false records into resolver caches.
2. Defend: port/ID randomisation, DNSSEC, patched software (Kaminsky-era fixes).
3. 0x20 encoding.
4. Don't run open resolvers.
5. Flush cache after incidents.
forged response → resolver cache (if accepted) → clients misdirected
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
dig +short porttest.dns-oarc.net TXTVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
dig +short porttest.dns-oarc.net TXT # source port randomness (rating GOOD/POOR)
dig @resolver example.com +dnssec | grep flags # ad flag = validated
rndc status # BIND version and state
Run resolvers on current versions and enable DNSSEC validation (dnssec-validation auto; in BIND).
Step 2 Common mistakes Narrow the fault
- Resolvers without source-port randomisation or DNSSEC validation.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Poisoning affects every client of the resolver.
- Source port randomization and DNSSEC validation defend against it.
- Unpatched resolvers are the usual target.
- Resolver source port randomisation — enabled
- DNSSEC validation — enabled
unbound-control dump_cache | grep <domain>— inspect cache (Unbound)
ReferenceWhy it matters1 section · depth on demand
Protection
- Source-port and query-ID randomisation (standard in modern resolvers; Kaminsky 2008).
- DNSSEC validation on resolvers.
- Patch resolvers (SAD DNS and similar side-channel attacks).
- Do not allow recursion for untrusted clients.
Symptom: many users sent to the wrong IP for a domain while authoritative servers return the right answer; flush the resolver cache after fixing (rndc flush, Clear-DnsServerCache).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
DNS cache poisoning inserts forged records into a recursive resolver's cache, so every client using that resolver is sent to an attacker-controlled address until the record expires. The Kaminsky attack (2008) showed how practical this was before modern defences.
Defences in modern resolvers:
| Defence | Effect |
|---|---|
| Random source ports and query IDs | Attacker must guess ~32 bits |
| 0x20 case randomisation | Additional entropy |
| DNSSEC validation | Forged answers fail for signed zones |
| Bailiwick checks | Ignore unrelated records in responses |
| Patched resolver software | Fixes for newer variants (e.g. SAD DNS) |
Run supported resolver software (Unbound, BIND, PowerDNS Recursor, Windows DNS) with current patches, enable DNSSEC validation, and do not expose recursive resolvers to the internet.
Kaminsky attack
In 2008 Dan Kaminsky showed attackers could query random subdomains and flood forged replies with a fake NS record, poisoning a whole zone. The fix was source port randomisation, giving ~32 bits of randomness (16-bit transaction ID + port). DNSSEC validation removes the problem for signed zones. SAD DNS (2020) used ICMP side channels to infer ports again — keep resolvers updated.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in DNS Security → DNS Cache Poisoning. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4033 · confidence 94%