Modern hardware and structured cabling system with patch cords inserted into patch panel outlets

DNSSEC Explained: Cryptographically Signing Your DNS

DNSSEC (Domain Name System Security Extensions) lets a resolver prove that a DNS answer really came from the zone’s owner and wasn’t changed on the way. Each zone signs its own records, each parent vouches for its child’s keys, and a validating resolver checks that chain of signatures from the root down before it trusts an A record or anything else.

Plain DNS can’t check that a response is genuine. A resolver trusts whatever answer matches its query ID and port, which leaves it open to cache poisoning and on-path attackers who point a hostname at an IP they control. DNSSEC signing closes that gap.

DNSSEC at a glance

  • Layer: application layer, as an extension to DNS rather than a new protocol.
  • Transport: the same as DNS, UDP and TCP port 53. Signed answers are bigger, so it relies on EDNS(0) (RFC 6891) and falls back to TCP when an answer is truncated.
  • Standards: RFC 4033 (concepts), RFC 4034 (the new records) and RFC 4035 (protocol changes and validation), plus RFC 5155 for NSEC3. RFC 8624 lists which algorithms to use. ECDSA P-256 (algorithm 13) and RSA/SHA-256 (algorithm 8) are the common ones today.
  • Flags: DO (DNSSEC OK, a flag in the EDNS OPT record) asks for signatures, AD (Authenticated Data) says the resolver validated the answer, and CD (Checking Disabled) asks the resolver not to validate.
  • Used for: origin authentication and integrity of DNS data, and proof that a name doesn’t exist. Not encryption.

How DNSSEC validation works, step by step

Verification runs from the top down. The resolver starts with one key it already trusts, the root zone’s key-signing key (its trust anchor), and each zone vouches for the next.

A validating resolver walks the DNSSEC chain of trustThe resolver starts with the root zone's key-signing key as its trust anchor. It asks a root server for example.com and gets a referral with the DS record for com and an RRSIG over it. It asks a .com server for the com DNSKEY set and gets it with an RRSIG, and checks the com key-signing key against the DS from the root. It asks .com for example.com and gets a referral with the DS for example.com and an RRSIG. It asks the example.com name server for its DNSKEY set and gets it with an RRSIG, and checks it against that DS. It asks example.com for the A record and gets the A record with an RRSIG, which it verifies with the example.com zone-signing key. Every link validates, so the answer is secure and is returned with the AD bit set.ResolverRoot.comexample.comtrust anchor: root KSKA? example.comDS com + RRSIGDNSKEY? comDNSKEY+RRSIGA? example.comDS + RRSIGDNSKEY?DNSKEY+RRSIGA? example.comA + RRSIGchain valid: AD set
Each zone's DS record, signed by its parent, vouches for the child's key, so one trusted root key is enough to authenticate the final answer.
  1. The resolver already holds the root’s DNSKEY set, fetched at start-up and checked against its built-in trust anchor.
  2. It asks a root server for example.com with the DO bit set and gets a referral to .com: the NS records, plus the DS record for com and an RRSIG over it. The resolver verifies that RRSIG with the root’s zone key.
  3. It asks a .com server for the com DNSKEY set and its RRSIG. It hashes the com key-signing key, checks it matches the DS the root signed, then verifies the RRSIG over the DNSKEY set with that key.
  4. It asks .com for example.com. The referral carries the DS for example.com, signed by a com zone key the resolver now trusts.
  5. It fetches the example.com DNSKEY set and repeats the DS match and RRSIG check.
  6. Finally it asks example.com for the A record. It verifies the RRSIG with the example.com zone-signing key, and checks the signature is inside its validity window.
  7. Every link checks out, so the resolver returns the answer to the client with the AD bit set.

Each answer ends up secure (the chain validated), insecure (a parent proved there is no DS), bogus (it should validate but doesn’t) or indeterminate. A bogus answer is thrown away, and the client gets SERVFAIL instead of a possibly forged answer.

Inside the DNSSEC records

DNSSEC adds four record types next to your existing A, MX and CNAME records:

  • RRSIG: a signature over one RRset (all records of one name and type). It holds the type covered, algorithm, label count, original TTL, expiration and inception times, the key tag of the signing key and the signer’s name.
  • DNSKEY: a public key for the zone. Flags 257 marks a key-signing key (KSK, with the Secure Entry Point bit) that signs the DNSKEY set. Flags 256 marks a zone-signing key (ZSK) that signs everything else. The protocol field is always 3. Some zones use one combined key for both jobs.
  • DS (Delegation Signer): a digest of the child’s KSK, published and signed in the parent zone. The .com registry holds the DS for example.com. This is the link in the chain of trust.
  • NSEC / NSEC3: signed proof that a name or type doesn’t exist, since you can’t sign something that isn’t there. NSEC names the next name in the zone. NSEC3 uses hashed names so the zone is harder to list.

Here are the records of a signed example.com with a separate KSK and ZSK, plus the DS that .com publishes for it (shortened, with comments added):

example.com.  3600  IN DNSKEY 257 3 13 mdsswUyr3DPW132mOi8V9xESWE8jTo0d... ; KSK, key id 2371
example.com.  3600  IN DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWz... ; ZSK, key id 46177
example.com.  3600  IN RRSIG  DNSKEY 13 2 3600 20261227000000 20261129000000 2371 example.com. kq3Vb8...
example.com.  3600  IN A      203.0.113.10
example.com.  3600  IN RRSIG  A 13 2 3600 20261227000000 20261129000000 46177 example.com. Hd7Wq2...
example.com.  86400 IN DS     2371 13 2 5E2C8A41F3B0D96C7E2A1B4F08D3C6E9A7B5F1D2C4E6A8B0D1F3E5A7C9B1D3F5

Read the RRSIG over the A record left to right: type A, algorithm 13, 2 labels, original TTL 3600, expiring 27 December 2026, valid from 29 November 2026, made by key tag 46177 (the ZSK). The DNSKEY set is signed by key tag 2371, the KSK, and the DS in .com names the same key tag 2371 with digest type 2 (SHA-256). That is how the parent’s DS points at one of the child’s keys.

The split means you can roll the ZSK as often as you like without touching the parent. Changing the KSK means a new DS at the registry.

See DNSSEC yourself with dig and delv

Query a validating resolver with the DO bit set and look for ad in the flags and an RRSIG beside the answer:

$ dig +dnssec example.com A

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41721
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232

;; ANSWER SECTION:
example.com.   3600  IN  A      203.0.113.10
example.com.   3600  IN  RRSIG  A 13 2 3600 20261227000000 20261129000000 46177 example.com. Hd7Wq2...

Other useful commands:

# the zone's keys, with key tags and KSK/ZSK labels
dig example.com DNSKEY +multi

# the DS the parent publishes for the zone
dig example.com DS +short

# validate locally instead of trusting the resolver's AD bit
delv example.com A
; fully validated
example.com.  3600  IN  A  203.0.113.10

# skip validation (CD bit) to see whether DNSSEC is what's failing
dig +cd example.com A

delv ships with BIND and walks the chain itself from its own trust anchor. It prints ; fully validated for a secure answer and ; unsigned answer for an insecure one. To watch the exchange on the wire, capture port 53 with tcpdump, or use the Wireshark display filter dns.flags.authenticated == 1 to pick out validated answers. Wireshark on Kali Linux covers the capture side.

Turning on DNSSEC signing for your domain

Most DNS providers, Cloudflare and Route 53 among them, generate, sign and rotate the keys for you. Your part is usually:

  1. Turn on DNSSEC signing in your DNS provider’s dashboard.
  2. Copy the DS record it gives you (key tag, algorithm, digest type and digest).
  3. Add that DS record in your registrar’s DNSSEC settings, so it is published in the parent zone.

Skip the last step and nobody upstream vouches for your signed zone, so resolvers treat it as unsigned. Once the zone is signed, records like CAA records are much harder to forge too.

What goes wrong with DNSSEC

When DNSSEC breaks, validating resolvers stop answering for the domain, and to users the site looks down.

An expired DNSSEC signature turns into SERVFAILThe laptop asks its validating resolver for the A record of example.com. The resolver queries the example.com name server with the DO bit set and gets the A record with an RRSIG whose expiration time has passed. The resolver marks the answer bogus and returns SERVFAIL to the laptop, with Extended DNS Error 7, Signature Expired. The laptop repeats the query with the CD bit set, and the resolver returns the answer without validating it and without the AD bit.LaptopResolverexample.comQuery A? example.comA? example.com DO=1A + RRSIG sig expiredbogus: signature expiredSERVFAIL EDE 7Query A? CD=1Answer no AD, unchecked
The validating resolver refuses a bogus answer and returns SERVFAIL; only a query with checking disabled (CD) gets the unvalidated data.

Expired signatures: every RRSIG has an expiration time. If the signer stops re-signing, the zone goes bogus on that date. If the resolver supports Extended DNS Errors (RFC 8914), recent versions of dig show the reason, for example ; EDE: 7 (Signature Expired) or ; EDE: 6 (DNSSEC Bogus). If dig +cd works and the normal query gives SERVFAIL, the problem is DNSSEC.

A stale DS: moving to a new DNS provider, or rolling the KSK, without updating the DS at the registrar leaves the parent pointing at a key the zone no longer publishes. When you move providers, remove the DS at the registrar first and wait out its TTL, then turn on signing at the new provider and add its DS.

Big answers: firewalls that drop UDP fragments or block TCP on port 53 cause timeouts that only appear when the DO bit is set. An EDNS buffer of 1232 bytes avoids most fragmentation.

A wrong clock: validation compares signature times with the resolver’s own clock, so a device with the wrong date can mark valid answers bogus.

Zone walking: NSEC chains let anyone list every name in a zone. NSEC3 hashes the names, which slows this down but doesn’t stop offline guessing.

What DNSSEC doesn’t do: it guarantees the integrity and origin of DNS answers, not privacy. Queries still travel in plaintext; encrypting them is the job of DNS over TLS and DNS over HTTPS. The AD bit is only as trustworthy as the path to your resolver, so delv or a local validating resolver is the stronger check.

Try it in Protocol Explorer

DNSSEC rides inside ordinary DNS messages, so learn those first. Protocol Explorer’s DNS lesson animates a lookup packet by packet in your browser, with a byte-level decoder for the header flags and each section, plus an exam mode. Protocol Explorer has free HTTP and HTTPS lessons, and the rest come with a one-time unlock.

More in this series

This post is part of the How network protocols work series. Start with how DNS works for the lookups DNSSEC protects, and read DNS over HTTPS explained for the privacy half it leaves out. MTA-STS uses DNS and a hosted policy file to make sure mail is delivered over an encrypted connection.