Sub topic 15
DNSSEC: Signing DNS Data
This chapter assumes you know how a recursive resolver walks from the root to an authoritative server, and how caching works. It also assumes you can read dig output.
The problem DNSSEC solves
Plain DNS answers carry no proof of origin. A resolver that accepts a forged answer, for example through cache poisoning, will cache it and hand it to every client. DNSSEC (DNS Security Extensions) adds digital signatures to DNS data. A validating resolver can then check that an answer came from the zone's owner and was not changed on the way.
DNSSEC provides origin authentication and data integrity. It does not encrypt anything. Anyone on the path can still read your queries, which is the job of DoT and DoH, covered in the next chapter.
The new record types
| Record | Purpose |
|---|---|
| DNSKEY | Holds a public key of the zone. |
| RRSIG | Holds a signature over one RRset (all records with the same name and type). |
| DS | Sits in the parent zone and holds a hash of the child's DNSKEY. |
| NSEC / NSEC3 | Prove that a name or record type does not exist, so "no such name" answers can also be validated. |
Zones usually have two keys. The key signing key (KSK) signs the DNSKEY RRset. The zone signing key (ZSK) signs all other RRsets. Splitting them lets you rotate the ZSK often without involving the parent zone.
The chain of trust
A resolver cannot verify a key by looking at the key alone. It checks the key against the parent, up to a trust anchor. The trust anchor is the root zone's public key, which is built into validating resolvers.
At each step the resolver confirms that the DS hash matches the child's DNSKEY, and that the DNSKEY verifies the signature on the next record set. If every link holds, the answer is "secure". If a zone has no DS record in its parent, it is simply unsigned ("insecure"), and the resolver accepts the answer as ordinary DNS.
Seeing it with dig
Add +dnssec to request signatures. A validating resolver sets the ad (authenticated data) flag when it has verified the answer.
dig +dnssec example.com A
dig +short example.com DNSKEY
dig +short example.com DSLook for ad in the flags: line and for RRSIG records in the answer section. To skip validation while debugging, add +cd (checking disabled). If a query fails with validation on but works with +cd, DNSSEC is the cause.
dig +cd example.com ACommon failure modes
- Expired signatures. RRSIG records have an inception and expiry time. If the signer stops re-signing, the zone breaks when they expire.
- DS mismatch. If you change the KSK but leave the old DS record at the parent, the chain breaks.
- Failure looks like an outage. A validating resolver returns SERVFAIL for bogus data, not a warning. Users of validating resolvers see the domain fail, while users of non-validating resolvers do not.
- Larger responses. Signatures make answers bigger, which pushes more traffic to TCP or EDNS0 large UDP packets.
Exercise
A validating resolver returns SERVFAIL for example.org, but dig +cd example.org A returns an answer. What does this tell you, and what two things would you check first?
Show answer
The data is reachable, but validation fails, so the zone's DNSSEC setup is broken. Check whether the RRSIG signatures have expired, and whether the DS record at the parent matches a current DNSKEY of the zone.