DS and DNSKEY records: DNSSEC explained
The DNSSEC records that sign a zone and link it to its parent in a chain of trust.
What it is
DNSSEC (DNS Security Extensions) adds digital signatures to DNS so that resolvers can check that an answer really comes from the zone owner and was not altered on the way. It is specified in RFC 4033, RFC 4034 and RFC 4035.
Two record types hold it together:
- DNSKEY records, published in your zone, contain the public keys used to verify the zone’s signatures.
- A DS record (delegation signer), published in the parent zone (for example
.com), contains a hash of one of your DNSKEY records. It is the link that says “this child zone is signed with this key”.
Other DNSSEC record types work alongside them: RRSIG holds the signatures, and NSEC or NSEC3 prove that a name or type does not exist.
How it works
DNSSEC builds a chain of trust from the root of the DNS down to your records:
- Validating resolvers ship with the root zone’s key (the trust anchor).
- The root zone publishes a DS record for
.com, signed with the root’s key. - The
.comzone publishes a DS record forexample.com, signed with.com’s key. example.compublishes DNSKEY records whose hash matches that DS record, and signs every record set in the zone with RRSIG records.- A resolver that receives the A record of
www.example.comchecks its RRSIG against your DNSKEY, your DNSKEY against the DS in.com, and so on up to the root.
If every link checks out, the resolver sets the AD (authenticated data) flag. If a link is broken, a validating resolver returns SERVFAIL rather than an answer it cannot trust. If a zone has no DS record in its parent, it is simply unsigned (“insecure”) and is answered normally.
KSK and ZSK
Most zones use two keys, distinguished by the flags field:
- The key signing key (KSK, flags
257) signs only the DNSKEY set. Its hash is what goes in the DS record, so changing it requires an update at the registrar. - The zone signing key (ZSK, flags
256) signs all other records. It can be rotated without touching the parent.
Some setups use a single combined key (CSK). Many DNS providers handle all of this automatically; you only need to copy the DS record to your registrar, and some registries and registrars can even pick up key changes automatically from CDS records (RFC 8078).
Syntax and fields
DNSKEY:
| Field | Example | Meaning |
|---|---|---|
| Flags | 257 |
257 = KSK (secure entry point), 256 = ZSK. |
| Protocol | 3 |
Always 3. |
| Algorithm | 13 |
Signing algorithm (see below). |
| Public key | mdsswUyr3D... |
The key, in base64. |
DS:
| Field | Example | Meaning |
|---|---|---|
| Key tag | 2371 |
Short identifier of the DNSKEY this DS refers to. |
| Algorithm | 13 |
Algorithm of that DNSKEY. |
| Digest type | 2 |
Hash function: 2 = SHA-256 (recommended), 4 = SHA-384, 1 = SHA-1 (deprecated). |
| Digest | 1F987CC6... |
Hash of the DNSKEY, in hexadecimal. |
Common algorithm numbers: 8 RSA/SHA-256, 10 RSA/SHA-512, 13 ECDSA P-256/SHA-256, 14 ECDSA P-384/SHA-384, 15 Ed25519.
Examples
The keys published in the zone (keys shortened):
example.com. 3600 IN DNSKEY 257 3 13 mdsswUyr3DPW132mOi8V9xESWE8jTo0d...
example.com. 3600 IN DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWz...
The matching DS record, published in the .com zone by the registry:
example.com. 86400 IN DS 2371 13 2 1F987CC6583E92DF0890718C42E4A4F3E1A2B9C0D7E6F5A4B3C2D1E0F9A8B7C6
A signature over the A record set (abbreviated):
www.example.com. 3600 IN RRSIG A 13 3 3600 20261109000000 20261026000000 34505 example.com. Ab3x...
The key tag and digest above are illustrative; real values are computed from your key.
Common mistakes
- DS at the registrar, but the zone is not signed (or is signed with a different key). This is the most common DNSSEC outage, and it often happens when moving to a new DNS provider. Validating resolvers return SERVFAIL for the whole domain.
- Changing DNS provider with DNSSEC on. The new provider signs with new keys. Either remove the DS, wait for its TTL, move, and re-enable; or follow a documented multi-provider key rollover. Never just swap nameservers.
- Expired signatures. RRSIG records have an expiry date. If a self-managed signer stops re-signing, the zone fails validation when signatures expire, typically a few days or weeks later.
- Rolling the KSK without updating the DS. Publish the new DS, wait for the old one to expire from caches, then retire the old key.
- Using deprecated algorithms or digests. Algorithms 5 and 7 and SHA-1 digests (type 1) should be replaced.
- Thinking DNSSEC protects the connection to the website. It protects DNS answers only. HTTPS still needs TLS certificates.
How to check it
Use the DNS lookup tool with type DNSKEY on your domain to see the published keys, and with type DS to see the record in the parent zone. Turn on the DNSSEC option to request signatures: the result then includes RRSIG records, and the AD flag shows whether the resolver validated the answer. The WHOIS lookup reports whether the registry lists the domain as signed.
Related records
Frequently asked questions
Does DNSSEC encrypt my DNS traffic?
No. DNSSEC proves that answers are authentic and unmodified; it does not hide them. Encryption between you and your resolver is provided by DNS over HTTPS (RFC 8484) or DNS over TLS. The two solve different problems and work well together.
What happens if my DS record is wrong?
Validating resolvers, including Cloudflare 1.1.1.1, Google Public DNS and Quad9, will return SERVFAIL for your domain, so it effectively disappears for a large share of users. Non-validating resolvers will still answer, which is why the problem can look intermittent.
How do I turn DNSSEC off safely?
Remove the DS record at your registrar first, then wait at least the TTL of the DS record in the parent zone (often one or two days) before you stop signing the zone. Doing it in the opposite order breaks resolution.
What does the AD flag in a lookup result mean?
AD (authenticated data) means the resolver validated the answer with DNSSEC. If you query a signed domain through a validating resolver and the AD flag is set, the chain of trust is intact.
Which algorithm should I use?
Algorithm 13 (ECDSA P-256 with SHA-256) is widely recommended today: small signatures and universal resolver support. Algorithm 8 (RSA/SHA-256) is also widely supported. Avoid algorithms 5 and 7 (RSA/SHA-1).