Resolvers and DNSSEC
Who answers, and whether you can believe them.
The resolver you ask decides more than the zone you ask about.
Three kinds of server
| Kind | Does | Example |
|---|---|---|
| Stub | asks one resolver and believes it | your operating system |
| Recursive | walks the chain from chapter 2 | 1.1.1.1, your ISP’s |
| Authoritative | holds a zone and answers for it | elliott.ns.cloudflare.com |
Your stub resolver reads one address from the system configuration and sends everything there. That address is the only choice you make.
Asking one server
@ picks the server. A recursive one does the work:
dig @1.1.1.1 +short example.com | sortAn authoritative one answers only for its own zone, and will not work on your behalf:
dig @198.41.0.4 +norecurse +noall +comments example.com 2>/dev/null \
| grep '^;; flags'No ra, no answer — a referral, as in chapter 2. The recursive resolver chases those so
your machine does not.
Picking a resolver
The choice changes the answers. Three in common use:
| Resolver | Validates DNSSEC | Notes |
|---|---|---|
1.1.1.1 |
yes | Cloudflare |
8.8.8.8 |
yes | |
| your ISP’s | maybe | the default, and the unknown |
What DNS does not guarantee
Nothing proves an answer came from the zone that owns it. Chapter 1’s query ID is 16 bits, and a forged reply arriving first is believed.
DNSSEC signs answers so a resolver can check them. It encrypts nothing — privacy is chapter 6.
RRSIG and DNSKEY
A zone signs each record set and publishes the keys that did it:
dig @1.1.1.1 +short DNSKEY cloudflare.com | awk '{print $1,$2,$3}' | sort256 is the zone-signing key that signs records; 257 is the key-signing key that signs
the DNSKEY set.
dig @1.1.1.1 +dnssec +noall +answer A cloudflare.com \
| awk '$4=="RRSIG"{print $4,$5,$6}' | head -113 is the algorithm, ECDSA P-256. An RRSIG covers a whole record set, which is why
chapter 3’s TTLs belong to sets.
DS at the parent
A zone’s own keys prove nothing — anyone can publish keys. The link is a hash of the key-signing key, stored in the parent:
dig @1.1.1.1 +short DS cloudflare.com | sort.com vouches for cloudflare.com, the root for .com, and a resolver ships with the
root’s key. That is the chain.
The ad flag
A validating resolver reports success in one bit:
dig @1.1.1.1 +dnssec +noall +comments cloudflare.com | grep '^;; flags'ad means authenticated data — this resolver checked the chain and it held.
A broken zone
dnssec-failed.org publishes signatures that do not validate, deliberately:
dig @1.1.1.1 dnssec-failed.org | grep 'HEADER'SERVFAIL, no address. The user sees a site that does not load — chapter 5.
cd
+cd is checking disabled. Same resolver, same name, an answer:
dig @1.1.1.1 +cd +short dnssec-failed.org | sort | head -1The records were always there. The resolver refused them for failing validation; +cd
told it not to validate.
Who validates
The same name, two resolvers, two different answers:
dig dnssec-failed.org | grep status:The ISP resolver tested here does not validate — NOERROR and an address for a zone
1.1.1.1 refuses.
dig @8.8.8.8 dnssec-failed.org | grep 'HEADER'Google validates too. Between them they cover a large share of queries, which is why signing is worth doing.