Skip to content
Sign inGet all access
Chapter 4·8 minFree

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 | sort
Output104.20.23.154172.66.147.243

An 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'
Output;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 27

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 Google
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}' | sort
Output256 3 13257 3 13

256 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 -1
OutputRRSIG A 13

13 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
Output2371 13 2 32996839A6D808AFE3EB4A795A0E6A7A39A76FC52FF228B22B76F6D6 3826F2B9

.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'
Output;; flags: qr rd ra ad; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

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'
Output;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 46846

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 -1
Output96.99.227.255

The 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:

your-resolver
dig dnssec-failed.org | grep status:
Output$ dig @1.1.1.1 dnssec-failed.org | grep status:;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 46846$ dig dnssec-failed.org | grep status:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41799

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'
Output;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 825

Google validates too. Between them they cover a large share of queries, which is why signing is worth doing.