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.

Lesson 7 of 17 · 11 min read · practice only with authorization

Diagram

Validating an answer

Follow the path. One example at a time.

Step 1 of 4

Query

A client asks its resolver for a name.

Illustration: Query
# 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.

  1. 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.
  2. 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.
  3. 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.

1 / 3

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.

  1. MapNetwork protocols for defenders: what each layer tells you in a captureEthernet, IP, TCP, UDP, DNS, TLS, and HTTP as they appear in a packet capture: the fields worth reading at each layer, a worked tcpdump trace of one web request, and which protocols leak what.

Practice

  1. LabControl benchA failure is described. Choose the control that changes the outcome.

Glossary

  1. CardDNS spoofingA resolver is fed a lie, and a name points at the wrong address.