DNSKEY Record
DNS Public Key
- Type code
- 48
- Status
- In use
- Defined in
- RFC 4034
What the DNSKEY record is for
A signed zone publishes its public keys as a DNSKEY record set at the zone apex. Resolvers use these keys to check the RRSIG signatures on the zone data. The DNSKEY set is itself signed, and a DS record in the parent zone points at one of the keys, which connects the zone to the chain of trust.
Most zones use two roles: a key-signing key (KSK) that signs only the DNSKEY set and is referenced by the parent DS, and a zone-signing key (ZSK) that signs everything else. The split is an operational convention; the protocol only distinguishes keys by the Secure Entry Point (SEP) flag, which by convention marks the KSK. Some zones use a single key for both roles.
DNSKEY records are only for DNSSEC. Keys for other applications belong in other record types (TLSA, SSHFP, OPENPGPKEY and so on).
Wire format and fields
| Field | Size | Meaning |
|---|---|---|
| Flags | 16 bits | Bit 7 is the Zone Key flag and must be set for a key used to verify zone data. Bit 15 is the Secure Entry Point flag. Bit 8 is the REVOKE flag from RFC 5011. So 256 is a zone key and 257 a zone key with SEP set (usually the KSK). |
| Protocol | 8 bits | Must be 3. A key with any other value is not valid for DNSSEC. |
| Algorithm | 8 bits | The DNSSEC algorithm number from the IANA registry, e.g. 8 (RSASHA256), 13 (ECDSAP256SHA256) or 15 (ED25519). |
| Public Key | variable | The key material, in the format the algorithm defines. Shown in base64 in zone files. |
Zone file syntax
<owner> <ttl> IN DNSKEY <flags> <protocol> <algorithm> <public key (base64)>
Example
The DNSKEY records at cloudflare.com, fetched from live DNS on 27 November 2026:
cloudflare.com. 1739 IN DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA== cloudflare.com. 1739 IN DNSKEY 257 3 13 mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+ KkxLbxILfDLUT0rAK9iUzy1L53eKGQ==
A zone-signing key (flags 256) and a key-signing key (flags 257), both ECDSA P-256 (algorithm 13).
Common mistakes
- Removing an old key during a rollover before the new one has been published for long enough. Resolvers still holding the old DNSKEY set or signatures in cache fail validation.
- Rolling the key-signing key without updating the DS record at the parent, which leaves no DS that matches a published key.
- Letting the DNSKEY set grow large during rollovers (several RSA keys plus their signatures). Large responses get fragmented or truncated over UDP and some resolvers fail to fetch them.
- Treating the key tag as unique. Different keys can share a key tag, so tools and scripts should compare the full key, not only the tag.
Specifications
- RFC 4034: Resource Records for the DNS Security Extensions
- RFC 5011: Automated Updates of DNS Security (DNSSEC) Trust Anchors (Adds the REVOKE flag and a procedure for rolling trust anchor keys.)
- RFC 6605: Elliptic Curve Digital Signature Algorithm (DSA) for DNSSEC (Adds ECDSA algorithms 13 and 14.)
- RFC 8080: Edwards-Curve Digital Security Algorithm (EdDSA) for DNSSEC (Adds Ed25519 (15) and Ed448 (16).)
- RFC 9905: Deprecating the Use of SHA-1 in DNSSEC Signature Algorithms (Deprecates creating keys and signatures with RSASHA1 and RSASHA1-NSEC3-SHA1.)
- IANA DNS Resource Record (RR) TYPEs registry: type code and status
Related record types
Domain Intelligence APIs
Get started with our easy-to-use API docs.