KEY Record

Security Key

Type code
25
Status
In use
Defined in
RFC 2535

What the KEY record is for

RFC 2535 defined KEY to hold zone signing keys and, through sub-types, keys for other applications such as email and IPsec. RFC 3445 removed the application sub-types and limited KEY to protocol 3 (DNSSEC). RFC 3755 then replaced KEY with DNSKEY for zone signing.

The type number was kept for one remaining use: holding the public key that a server uses to verify SIG(0) signatures (RFC 2931) and for TKEY key exchange (RFC 2930). For example, a client can sign dynamic updates with SIG(0) and the server looks up the client KEY record to check them.

KEY is rarely seen. Zones that need DNSSEC keys use DNSKEY, and most transaction signing uses TSIG with a shared secret instead of SIG(0).

Look up the DNSKEY records of cloudflare.com →

No public domain we found publishes a KEY record, so this looks up the DNSKEY records of cloudflare.com, the type that replaced KEY for DNSSEC.

Wire format and fields

FieldSizeMeaning
flags16 bitsKey flags. After RFC 3445 most of the original sub-type bits are no longer used.
protocol8 bitsMust be 3 in authoritative data since RFC 3445; other values are deprecated.
algorithm8 bitsThe algorithm number from the DNS Security Algorithm Numbers registry; it must be one marked usable for transaction security.
public keyvariableThe key material, base64 in zone files.

Zone file syntax

<owner> <ttl> IN KEY <flags> <protocol> <algorithm> <public key (base64)>

Common mistakes

  • Publishing a zone signing key as KEY instead of DNSKEY. Current validators ignore KEY for DNSSEC, so the zone is not seen as signed.
  • Using KEY to publish application keys (email, IPsec, SSH). RFC 3445 forbids this; use OPENPGPKEY, SMIMEA, IPSECKEY or SSHFP instead.
  • Publishing a KEY with a protocol value other than 3, which RFC 3445 says must not appear in authoritative data.

Specifications

  • RFC 2535: Domain Name System Security Extensions
  • RFC 3445: Limiting the Scope of the KEY Resource Record (RR) (Removes the application sub-types and requires protocol 3.)
  • RFC 3755: Legacy Resolver Compatibility for Delegation Signer (DS) (Replaces KEY with DNSKEY for DNSSEC and keeps type 25 for SIG(0) and TKEY only.)
  • RFC 2931: DNS Request and Transaction Signatures ( SIG(0)s ) (SIG(0) signatures are verified against a KEY record.)
  • RFC 2930: Secret Key Establishment for DNS (TKEY RR) (TKEY can use KEY records in key agreement.)
  • 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.