opyebDNSSECLab

DNSKEY flags and algorithms — telling KSK from ZSK and choosing one

Basics · 7 min

In one line: What flags 256 and 257 mean together with the SEP and REVOKE bits, why protocol must be 3, and how to choose between algorithms 8, 13, 14, 15 and 16.

The flags field of a DNSKEY says what the key does. Most operators memorise 256 and 257 and move on, but a single bit changes both rollover procedure and validation behaviour.

1. Reading the flag bits

BitValueMeaning
0x0100256Zone Key: this key signs zone data. Required for any DNSKEY.
0x00011SEP (Secure Entry Point): the key a parent DS points at. Set on a KSK.
0x0080128REVOKE: the key is revoked and must not be trusted.
  • 256 — zone key only: a ZSK, signing ordinary zone data.
  • 257 — zone key plus SEP: a KSK, signing the DNSKEY RRset and linked to the parent by DS.
  • A single 257 key (a CSK, combined signing key) is common on small zones and simpler to operate.

Protocol must always be 3. Any other value makes resolvers ignore the key; the DNSSECLab linter reports it as an error.

2. Algorithm numbers

No.NameStatusPublic key
8RSASHA256usable1280–4096 bits
10RSASHA512usable1280–4096 bits
13ECDSAP256SHA256recommended64 bytes
14ECDSAP384SHA384recommended96 bytes
15ED25519recommended32 bytes
16ED448usable57 bytes
5, 7RSASHA1 familydeprecated—
1, 3, 6RSAMD5, DSA familyobsolete—

RFC 8624 recommends ECDSA P-256/P-384 and Ed25519 for new deployments, and SHA-256 or better when using RSA. SHA-1 algorithms remain only for validator compatibility.

3. Choosing

  • Maximum compatibility: algorithm 8 (RSA/SHA-256), 2048 bits or more.
  • General purpose: algorithm 13 (ECDSA P-256); short signatures, fast validation.
  • Smallest responses: algorithm 15 (Ed25519); 32-byte keys and 64-byte signatures. Check that your tooling supports it.
  • Policy driven: P-384 (14) or Ed448 (16) where stronger parameters are required.

Changing algorithm is not the same as changing keys: publish the new DNSKEY first, add the new DS at the parent, then remove the old key. Skipping a step breaks validation.

4. Key lengths and TTLs

Public key lengths are fixed per algorithm: 64 bytes for 13, 96 for 14, 32 for 15. The linter reports a mismatch as L_DNSKEY_LEN. DNSKEY and DS TTLs bound how long an old key can still be cached, so lower them before a rollover.

Computing a single DS record makes the relationship between the key tag and the digest concrete.

Open DNSSECLab

Frequently asked questions

Do I have to separate KSK and ZSK?

No. A small zone can run a single 257 key (CSK). Separating them makes key rollover cheaper because the DNSKEY RRset signing and zone data signing are managed independently.

What happens if REVOKE is set on a 257 key?

Resolvers treat the key as revoked and stop trusting it. It is used for emergency revocation after a key compromise, and setting it by accident causes immediate validation failure.

Why choose Ed25519 (15)?

Keys are 32 bytes and signatures 64, so DNS responses are smaller and validation faster than RSA. Older appliances and some management tools may not support it, so test first.

References

Read next

0 bytes of your input sent to a server (advertising and affiliate widgets excluded)