DNSKEY record

On this page 7

A DNSKEY record is the resource record type that publishes the public keys of a DNSSEC-signed zone, allowing validating resolvers to check the digital signatures attached to the zone’s data. Among the DNS records that make up the naming system of the Internet, it is the anchor of cryptographic authenticity: without it, the RRSIG signatures on A, MX or TXT records cannot be verified, and DNSSEC provides no protection.

The record type was defined in RFC 4034 as part of the DNSSEC specification and carries type code 48. It always sits at the zone apex, never at an arbitrary name, and it works in tandem with the DS record stored in the parent zone, which links the child’s keys into the global chain of trust that begins at the root.

How the DNSKEY record anchors DNSSEC validation

The DNSKEY record makes signature verification possible by giving resolvers the public half of the zone’s key pairs. The zone operator keeps the private keys offline or in a signing system, signs every record set with them, and publishes the matching public keys as DNSKEY records at the apex.

A validating resolver follows a fixed sequence. It fetches the record set it needs together with its RRSIG signature, retrieves the zone’s DNSKEY set, and checks that a key with the matching key tag and algorithm verifies the signature. It then confirms that the DNSKEY set itself is trustworthy by matching one of its keys against a DS record in the parent zone, repeating the process upward until it reaches the configured root trust anchor.

The following table summarizes the role each related record plays in this validation path.

RecordLocationRole in validation
DNSKEYChild zone apexPublishes public keys of the zone
RRSIGNext to every signed record setCarries the signature over that set
DSParent zone at the delegationHolds a hash of the child’s key
NSEC or NSEC3Throughout the child zoneProves that a name or type does not exist
Root trust anchorResolver configurationStarting point of the chain of trust
Records involved in DNSSEC validation

Fields of the DNSKEY record

Every DNSKEY record has four fields in its RDATA: flags, protocol, algorithm and the public key. In presentation format a typical entry reads example.org. 3600 IN DNSKEY 257 3 13 mdsswUyr3DPW..., where the numbers before the key are the first three fields.

FieldSizeTypical valuesMeaning
Flags16 bits256 or 257Zone Key bit and Secure Entry Point bit
Protocol8 bitsAlways 3Fixed value; any other value is invalid
Algorithm8 bits8, 13, 15Signing algorithm used with the key
Public keyVariableBase64 textKey material in algorithm-specific format
DNSKEY record fields and their meaning

The flags value 256 marks a zone key without the Secure Entry Point bit, conventionally a zone signing key. The flags value 257 sets the Secure Entry Point (SEP) bit as well, signaling that the key is intended to be referenced from the parent through a DS record. The SEP bit is only a hint for tooling and operators; validators do not treat it as a security property.

Resolvers also compute a 16-bit key tag from the record contents. The key tag is not stored as a field, but it appears in RRSIG and DS records so that a resolver can quickly select the right key when several are published. Because key tags can collide, validators must try every matching key rather than trusting the tag alone.

Key signing keys and zone signing keys

Most signed zones publish at least two DNSKEY records with different duties, a split that lets operators rotate frequently used keys without contacting the parent registry. The key signing key (KSK) signs only the DNSKEY record set, while the zone signing key (ZSK) signs all other record sets in the zone.

PropertyKey signing keyZone signing keyCombined signing key
Flags value257256257
SignsDNSKEY set onlyAll other record setsEvery record set
Referenced by DSYesNoYes
Typical rolloverEvery few years or neverMonthly to yearlyRarely, with parent update
Main benefitStable parent linkEasy rotationSimpler operations
Comparison of key roles published as DNSKEY records

A combined signing key (CSK) performs both roles with a single key. With modern elliptic curve algorithms such as ECDSA P-256 (algorithm 13) and Ed25519 (algorithm 15), keys and signatures are small, so many operators now prefer a single CSK and accept that any rollover requires a DS update at the parent.

Algorithms and response size

The algorithm number in a DNSKEY record determines key length, signature size and validator support. Choosing it affects how large DNS responses become, which matters because oversized UDP responses may be fragmented or truncated and force a retry over TCP.

Algorithm numberNameStatusSize impact
8RSA/SHA-256Widely supported, still commonLarge keys and signatures
13ECDSA P-256 with SHA-256Recommended defaultSmall keys and signatures
15Ed25519Recommended, support growingSmallest signatures
5 and 7RSA/SHA-1 variantsDeprecated, must not be used for signingLarge and weak
Common DNSKEY algorithms

An RSA DNSKEY set during a rollover can exceed 1,232 bytes, the EDNS buffer size widely recommended to avoid fragmentation. The same set with ECDSA keys usually stays well below that limit, which is one practical reason for the shift toward elliptic curve algorithms across top-level domains and large hosting platforms.

Key rollovers and operational risks

Replacing a DNSKEY is called a key rollover, and it is the most failure-prone task in DNSSEC operations. Because resolvers cache DNSKEY sets and DS records according to their time to live (TTL), old and new keys must overlap long enough for every cache to see a consistent chain.

Two methods dominate. The pre-publish method adds the new key to the DNSKEY set before it signs anything, waits at least one TTL, then switches signing. The double-signature method signs with both keys at once, which is simpler but enlarges responses. KSK rollovers add a parent step: the new DS must be published and the parent’s DS TTL must expire before the old key is withdrawn. The CDS and CDNSKEY records defined in RFC 7344 and RFC 8078 let a child signal the new key to a parent that supports automated updates.

SymptomLikely causeFix
SERVFAIL on validating resolversDS points to a removed DNSKEYRestore the key or update the DS
Validation failures after rolloverOld key removed before TTL expiredRespect cache timers before removal
Signatures fail to verifyExpired RRSIG over the DNSKEY setRe-sign and monitor expiry dates
Truncated responsesOversized DNSKEY set with RSA keysMove to ECDSA or reduce published keys
Typical DNSKEY failures and their remedies

A broken DNSKEY chain does not degrade gracefully. Validating resolvers return SERVFAIL for the entire zone, so users of large public resolvers simply cannot reach the domain while non-validating resolvers keep working, which often confuses troubleshooting.

In simple terms

A DNSKEY record is like a public seal pattern that a domain hangs on its front door. Every answer the domain gives carries a matching stamp. Anyone can compare the stamp with the pattern. If they match, the answer is genuine and unchanged.

The parent domain, such as the registry for .org, vouches for that pattern. It keeps a fingerprint of it. This chain of vouching runs up to the root of the Internet. As a result, a forged answer fails the comparison and is rejected.

A practical example

A regional bank enables DNSSEC for its online banking domain at its DNS hosting provider. The provider generates a single ECDSA P-256 combined signing key, publishes it as a DNSKEY record with flags 257 and a TTL of 3,600 seconds, and signs the zone. The bank’s administrator then submits the matching DS record through the registrar, which forwards it to the registry of the top-level domain.

Within a few hours, validating resolvers at large internet providers begin checking the bank’s answers. Months later, an attacker on a public Wi-Fi network attempts to inject a forged A record that points the banking domain to a phishing server. The forged record carries no valid RRSIG from the published key, so the customer’s validating resolver discards it and the spoofing attempt fails silently.

When the provider later rolls the key, it publishes the new DNSKEY first, uses CDS signaling to update the parent, and removes the old key only after the DS TTL has expired, so customers see no outage.