DNSSEC: Signed Zones, the Chain of Trust and TSIG
How DNSSEC lets resolvers verify DNS answers: DNSKEY, RRSIG, DS and NSEC/NSEC3 records, KSKs and ZSKs, the chain of trust from the root, validation and SERVFAIL, plus TSIG, SIG(0) and TKEY for transactions and DNS64, with a signed three-level lab hierarchy.
kvi5hnuCode Sprout team member15 min readOn this page
Plain DNS (articles 49 to 56) has no protection at all. A resolver accepts any answer that matches its query's ID and port, so an attacker who can guess them (cache poisoning) or sits on the path can send a user to the wrong address. TLS would catch the wrong server for HTTPS, but plenty of DNS data isn't checked by anything else: mail routing (MX, mail exchanger records), service records, and the DKIM, SPF and DMARC policies in article 85.
The DNS Security Extensions (DNSSEC, RFCs 4033, 4034 and 4035) add data origin authentication and integrity to DNS: each set of records is signed by the zone that owns it, and a resolver can check the signature up a chain of trust to a key it already knows. DNSSEC also proves that a name or record type doesn't exist. It doesn't provide confidentiality (DNS over TLS or HTTPS does that), access control, or protection against denial of service.
The lab builds a small private DNS tree with three signed zones: a root (., server a.root.test at 198.51.100.201), com. (198.51.100.202) and example.com. (ns1.example.com, 198.51.100.53), plus a validating BIND 9.20 resolver (BIND is the most widely used open-source DNS server) at 198.51.100.99 configured with the lab root's key as its trust anchor.
The DNSSEC records
DNSSEC signs RRsets: all the records with the same name, class and type, such as every A record for www.example.com. Four record types do the work.
DNSKEY
A zone publishes its public keys in DNSKEY records at the zone apex:
example.com. IN DNSKEY 256 3 13 UTgoq3M+50DOZu5h… (88 base64 chars)
example.com. IN DNSKEY 257 3 13 1s8Y6gzAXrvOmB9u… (88 base64 chars)
key tag 46641: ZSK (flags 256)
key tag 63545: KSK (flags 257, SEP bit set)
The fields are flags, protocol (always 3) and algorithm (13 is ECDSA P-256 with SHA-256 from article 79, the most common choice today; 8 is RSA/SHA-256 and 15 is Ed25519), then the key itself in base64. The older SHA-1 algorithms 5 and 7 are legacy: RFC 9905 (November 2025) says they must no longer be used for signing, nor SHA-1 (digest type 1) for DS records, and validators treat zones signed only with them as unsigned. Each key is referred to by a 16-bit key tag, a checksum of the record.
Zones usually have two kinds of key, distinguished by the flags:
- The key-signing key (KSK), flags 257 (the Zone Key bit plus the Secure Entry Point bit), signs only the DNSKEY RRset. It's the key the parent zone vouches for.
- The zone-signing key (ZSK), flags 256, signs all the other RRsets.
The split lets a zone change its ZSK often without involving the parent, and keep the KSK, which needs a coordinated update with the parent to change, for longer. A single combined signing key (CSK) doing both is also common, and the default in BIND's dnssec-policy.
RRSIG
Each signed RRset has an RRSIG record holding the signature:
;; ANSWER SECTION:
www.example.com. 3600 IN A 203.0.113.80
www.example.com. 3600 IN RRSIG A 13 3 3600 (
20261220230529 20261120230529 46641 example.com.
Tkzp3vJwi69KxeZZpM2T…
Rfveu6MmpgGfRNpg1PFc… )
After the type covered (A) come the algorithm (13), the number of labels in the owner name (3, which lets a validator detect wildcard expansion), the original TTL (3600), the signature's expiration and inception times, written as YYYYMMDDHHMMSS in UTC (here 20261220230529 and 20261120230529: December 20 and November 20, 2026, a 30-day validity period), the key tag of the signing key (the ZSK), the signer's name, and the signature. Validity periods mean that signed zones must be re-signed regularly, or they stop working when the signatures expire. They also limit how long an attacker can replay old, correctly signed data.
DS
The delegation signer (DS) record links a child zone to its parent. It holds a hash of the child's KSK, and it lives in the parent zone, signed with the parent's keys:
example.com. IN DS 63545 13 2 859C2814C1B0D2B67348F92B1DC7…
from the com server: 63545 13 2 859C2814C1B0D2B67348F92B1DC7350657613F993E416955…
The fields are the KSK's key tag (matching the KSK above), its algorithm, the digest type (2 is SHA-256) and the digest. The registrar or registry publishes it when the zone owner submits it. CDS and CDNSKEY records (RFC 7344, RFC 8078) let a child publish the DS it wants in its own zone, so parents that support them can update it automatically.
NSEC and NSEC3
To prove a name doesn't exist, a zone can't sign "no such name" in advance for every possible query. Instead, NSEC records link every name in the zone, in canonical order, to the next one, and list the types that exist at each name. A signed NSEC that says "after mail.example.com comes ns1.example.com" proves there's nothing in between:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 54099
mail.example.com. 300 IN NSEC ns1.example.com. A RRSIG NSEC
example.com. 300 IN SOA ns1.example.com. hostmaster.example.com. 2026112101 7200 900 1209600 300
example.com. 300 IN NSEC mail.example.com. A NS SOA MX TXT RRSIG NSEC DNSKEY

The NXDOMAIN answer included the NSEC covering nosuch.example.com (between mail and ns1) and the apex NSEC, which proves no wildcard *.example.com exists that could have matched. NSEC records also answer "the name exists but not with this type" (NODATA): the type bitmap shows what's there.
The drawback is zone walking: by following the chain, anyone can list every name in the zone. NSEC3 (RFC 5155) chains SHA-1 hashes of the names instead, with an optional salt and iterations. Hashes of short names can still be cracked offline, so NSEC3 mainly raises the cost, and RFC 9276 recommends no salt and zero extra iterations, since more only burden resolvers. An opt-out flag lets large delegation-only zones like com. skip unsigned delegations. Large DNS providers increasingly sign answers on the fly, which allows compact denial of existence (RFC 9824): a minimal NSEC that covers only the queried name, revealing nothing else.
Canonical form and the chain of trust
Signatures are computed over a canonical form of the RRset: names in lowercase, records sorted, the original TTL rather than the decremented one. Otherwise, harmless differences between servers would break signatures.
A validating resolver starts from a trust anchor, usually the root zone's KSK, and works down:

delv, BIND's validation debugging tool, shows each fetch it needs:
;; fetch: www.example.com/A
;; fetch: example.com/DNSKEY
;; fetch: example.com/DS
;; fetch: com/DNSKEY
;; fetch: com/DS
;; fetch: ./DNSKEY
; fully validated
www.example.com. 3600 IN A 203.0.113.80
www.example.com. 3600 IN RRSIG A 13 3 3600 20261220230529 20261120230529 46641 example.com. …
To trust www.example.com A, it needed the RRSIG and the example.com DNSKEY set (to check the signature), the example.com DS from com (to check the KSK), com's DNSKEY set and its DS from the root, and the root's DNSKEY set, which matched the trust anchor. The zone cut between parent and child is where the chain moves from one zone's keys to the next: the parent signs the DS but not the child's NS records, which are authoritative in the child.
A normal client (a stub resolver) usually doesn't validate. It trusts the resolver's AD (authenticated data) bit:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9573
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
www.example.com. 3600 IN A 203.0.113.80
www.example.com. 3600 IN RRSIG A 13 3 3600 20261220230529 20261120230529 46641 example.com. …
The resolver set ad because the chain validated. A client can set the DO (DNSSEC OK) bit, +dnssec in dig, to receive the RRSIGs, and the CD (checking disabled) bit to ask for data even if validation fails. The AD bit is only meaningful if the path between stub and resolver is trusted, for example on the same machine or over DNS over TLS.
Signed answers are bigger:
dig www.example.com: MSG SIZE rcvd: 122
dig +dnssec www.example.com: MSG SIZE rcvd: 443
dig +dnssec DNSKEY example.com: MSG SIZE rcvd: 442
With ECDSA keys, the answer for one A record grew from 122 to 443 bytes; RSA signatures are bigger still. That's why DNSSEC depends on EDNS0's larger UDP payloads (article 51), and why answers that don't fit fall back to TCP.
When validation fails
To see what an attack looks like, the lab changed www.example.com's address in the signed zone file to 203.0.113.66 without re-signing it, and restarted the server:
zone file now: www.example.com. 3600 IN A 203.0.113.66
normal query: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1583
with +cd: www.example.com. 3600 IN A 203.0.113.66
resolver log: validating www.example.com/A: no valid signature found
The validating resolver refused to answer, with SERVFAIL, because the RRSIG no longer matched. With CD set, it handed over the bad data. That's the deal DNSSEC offers: a forged answer becomes a failure, not a wrong answer. It's also DNSSEC's operational risk. An expired signature, a DS left behind after changing DNS provider, or a botched key rollover makes the whole zone unreachable for validating resolvers' users. Tools such as DNSViz and delv help diagnose these, and automated signing (dnssec-policy in BIND, and similar in Knot and PowerDNS) has made such mistakes much rarer.
Nearly all top-level domains and the root are signed. The root's KSK was changed for the first time in 2018. In a second rollover, the new key KSK-2024 (key tag 38696) took over signing on October 11, 2026, and the old KSK-2017 is due to be revoked and removed in 2027. Validation is turned on in most large public resolvers and many ISPs', so a good fraction of users are protected. Signed second-level domains remain a minority in most TLDs (top-level domains such as com or org), though: zone owners and registrars must both take part.
Transaction security: TSIG, SIG(0) and TKEY
DNSSEC protects data, whoever delivers it. Some DNS transactions need protecting too: zone transfers between primary and secondary servers, and dynamic updates (article 53) that change a zone. TSIG (RFC 8945) authenticates a single DNS message with an HMAC (a keyed hash, article 79), keyed with a secret shared between the two servers. The lab's example.com server allows transfers and updates only with the key xfr-key:
without key: ; Transfer failed.
with key: XFR size: 29 records (messages 1, bytes 2165)
xfr-key. 0 ANY TSIG hmac-sha256. 1795219532 300 32 hukFgYolCYUk… (64439 NOERROR 0)
Without the key, the transfer was refused. With it, all 29 records (data, RRSIGs, NSECs and DNSKEYs) arrived, and the response carried a TSIG pseudo-record: the key name, the algorithm (hmac-sha256), the time it was signed (1795219532, in seconds since 1970), the allowed clock skew (300 seconds, so the servers' clocks must roughly agree), the 32-byte MAC, and in brackets the original message ID, an error field and the length of an optional extra field. TSIG records are never cached or stored; they belong only to that message. Dynamic updates work the same way:
unsigned update: update failed: REFUSED
api.example.com. 300 IN A 203.0.113.81
api.example.com. 300 IN RRSIG A 13 3 300 20261220193515 20261120230532 46641 example.com. …
The unsigned update was refused. The TSIG-signed one (nsupdate -k, which prints nothing on success) added api.example.com, and the server signed the new record with the zone's ZSK by itself, because it had the keys.
SIG(0) (RFC 2931) does the same job with a public-key signature instead of a shared secret, which avoids distributing secrets but is rarely deployed. TKEY (RFC 2930) negotiates TSIG keys dynamically, for example with Diffie-Hellman or with Kerberos (GSS-TSIG, after the Generic Security Service interface that Kerberos is used through, which is how Windows domain members update Active Directory DNS).
DNSSEC and DNS64
DNS64 (article 38) synthesizes AAAA records for IPv4-only names so IPv6-only clients can reach them through NAT64. A synthesized record can't carry a valid signature, because the DNS64 server doesn't have the zone's private key. So a DNS64 server that receives a query with DO and CD set (from a client that validates itself) returns the real, signed A data and doesn't synthesize. Validating clients behind DNS64 must do the synthesis themselves after validating, discovering the NAT64 prefix with the method in RFC 7050.
Common questions
Does DNSSEC encrypt my DNS queries?
No. It only authenticates the answers. For privacy, use DNS over TLS, DNS over HTTPS or DNS over QUIC between you and your resolver. The two are complementary.
Why does a DNSSEC mistake cause an outage instead of a warning?
A validating resolver can't distinguish a misconfiguration from an attack, and failing open would let attackers bypass DNSSEC by breaking signatures. So it answers SERVFAIL. Resolvers can be told to skip validation for a broken domain temporarily (a negative trust anchor, RFC 7646).
Why have both a KSK and a ZSK?
The ZSK signs many records and is changed frequently without telling anyone. The KSK signs only the DNSKEY set, and changing it requires updating the DS in the parent. The split separates the frequent operation from the coordinated one.
What stops an attacker from replaying an old, validly signed record?
Only the RRSIG's expiration time. Until a signature expires, an attacker who recorded it can replay it, even if the zone owner changed the record. Short signature validity periods limit that window.
What is DANE?
DNS-based Authentication of Named Entities (RFC 6698) publishes certificate information in DNSSEC-signed TLSA records, so a client can check a server's certificate against the DNS instead of, or as well as, the CA system. It's used mainly between mail servers (SMTP with DANE), where it prevents downgrade attacks on STARTTLS (the SMTP command that upgrades a plain connection to TLS).
Why does NSEC3 still allow guessing names?
NSEC3 reveals hashes of all the names, and an attacker can hash a dictionary of likely names (www, mail, vpn) offline and compare. It prevents trivial listing, not determined guessing.
Summary
- DNSSEC signs RRsets so that resolvers can verify origin and integrity, and proves non-existence. It gives no confidentiality.
- DNSKEY records hold a zone's public keys (KSK with flags 257, ZSK with 256); RRSIG records hold signatures with inception and expiration times; DS records in the parent hash the child's KSK; NSEC and NSEC3 records chain names to prove denial.
- A validator starts at a trust anchor (the root KSK) and follows DNSKEY → DS → DNSKEY down to the answer; the lab's
delvfetched six RRsets to validate one A record. - The resolver sets AD for validated answers and answers SERVFAIL when validation fails; the lab's tampered A record became SERVFAIL, readable only with CD.
- Signed answers are larger (122 → 443 bytes in the lab), so DNSSEC relies on EDNS0 and TCP fallback.
- TSIG authenticates individual transactions (zone transfers, dynamic updates) with an HMAC and a time; SIG(0) uses public keys and TKEY negotiates keys. DNS64 can't sign synthesized records, so validating clients must synthesize themselves.
Practice questions
1. An RRSIG has inception 20261120000000 and expiration 20261220000000. A resolver whose clock says December 21, 2026 receives it. What happens, and why might a busy operator see this?
Answer
The signature has expired, so validation fails and the resolver returns SERVFAIL. It typically means the zone wasn't re-signed: a signing job stopped, or a hidden primary failed to push updates to its secondaries. Resolvers with badly wrong clocks also see it.
2. A domain owner moves to a new DNS provider, which signs the zone with new keys, but the old DS record stays at the registry. What do validating users see?
Answer
SERVFAIL for every name in the zone: the DS in the parent matches no DNSKEY in the child, so the chain is broken. The fix is to publish the new DS (or remove the DS to go unsigned) at the registrar, ideally before switching providers, and wait for the old DS's TTL to expire.
3. Why is the DS record in the parent zone rather than in the child?
Answer
It's the parent's statement about which key the child uses, and it must be signed by a key the validator already trusts, the parent's. If the child published its own DS, an attacker controlling the child's answers could publish one for their own key.
4. A query for ftp.example.com in the lab zone returns NXDOMAIN. Which NSEC record proves it?
Answer
In canonical order, ftp sorts after the apex example.com and before mail.example.com, so the apex NSEC (example.com. NSEC mail.example.com.) covers it. The same apex NSEC also proves that no wildcard *.example.com exists, since * sorts right after the apex too.
5. Why does TSIG include the time the message was signed and a fudge value?
Answer
To stop replay: without a timestamp, an attacker could resend a recorded, validly signed dynamic update later. The receiver rejects messages whose time is outside the fudge window (300 seconds in the lab), which also means the servers' clocks must be synchronized.
6. A laptop's stub resolver gets an answer with the AD bit set from the coffee shop's Wi-Fi resolver. Should it trust it?
Answer
No. The AD bit is unauthenticated: anyone between the laptop and that resolver, or the resolver itself, can set it. AD is only meaningful from a resolver reached over a trusted path (localhost, or an encrypted, authenticated connection). Otherwise the laptop must validate itself.
Previous: TLS 1.3: The Handshake, Record Protocol, 0-RTT, ECH and DTLS

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.