DNS spoofing and cache poisoning: forged answers and how DNSSEC helps
Forged DNS answers send users to the wrong address. How poisoning works against resolvers, why source-port randomization and DNSSEC matter, and how to check a resolver and a domain with dig and delv.
Diagram
Validating an answer
Step 1 of 4
Query
A client asks its resolver for a name.
# Query # A client asks its resolver for a name.
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Resolver hardening
- What fails
- Random source ports and query ids make guessing hard.
- Who is affected
- Every client of the resolver.
- What you would notice
- Resolvers using a fixed source port.
- What you change
- Use current resolver software and keep port randomization on.
DNSSEC validation
- What fails
- Signatures prove answers came from the zone owner.
- Who is affected
- Users of validating resolvers.
- What you would notice
- Answers without the ad flag from your resolver for signed zones.
- What you change
- Turn on validation and sign your own zones.
Local overrides
- What fails
- Hosts files and rogue DHCP-assigned resolvers redirect names locally.
- Who is affected
- The affected host.
- What you would notice
- Unexpected resolver addresses or hosts entries.
- What you change
- Manage resolver settings centrally and monitor hosts files.
Debugging validation
delv performs validation itself and explains failures, which helps when a signed zone breaks.
$ delv example.org A ; fully validated example.org. 3600 IN A 93.184.215.14 $ delv dnssec-failed.org A ;; resolution failed: SERVFAIL ;; validating dnssec-failed.org/DNSKEY: no valid signature found
Why 2008 mattered
Dan Kaminsky’s 2008 disclosure showed poisoning could target whole domains quickly, which led to coordinated patches that randomized source ports. DNSSEC is the lasting fix because it does not depend on guessing odds.
Check yourself
Recognition and the fix. Nothing here is a procedure.
What does the ad flag in a dig response mean?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.