Introduction
DNSSEC protects DNS responses from forgery by cryptographically signing zone data. But the operational challenge isn’t the signing itself — it’s key management. Generating, rotating, and revoking DNSSEC keys securely is critical: a compromised ZSK can poison an entire domain’s cache, and misconfigured KSK rollovers can make your zone unreachable. This article compares three battle-tested DNSSEC key management toolchains: dnssec-keygen (BIND), ldns-keygen (NLnet Labs), and keymgr (Knot DNS).
| Feature | dnssec-keygen (BIND) | ldns-keygen (ldns) | keymgr (Knot DNS) |
|---|---|---|---|
| Parent Project | ISC BIND 9 | NLnet Labs ldns | CZ.NIC Knot DNS |
| Stars | 743 | 352 | 306 |
| Algorithm Support | All (5-16) | All (5-16) | ECDSA, EdDSA, RSA |
| Key Format | .key/.private files | .key/.private files | PEM, PKCS#8 |
| HSM Support | PKCS#11 native | PKCS#11 via OpenSSL | PKCS#11 native |
| Automated Rollover | Manual (dnssec-settime) | Manual (scripts) | Built-in (keymgr) |
| Algorithm Rollover | Supported | Manual | Automatic |
| Last Updated | June 2026 | May 2026 | June 2026 |
dnssec-keygen: The BIND Standard
dnssec-keygen is part of ISC BIND 9, the most widely deployed DNS server. It generates DNSSEC key pairs and outputs them in BIND’s .key/.private file format. It supports every DNSSEC algorithm from RSA/SHA-1 (algorithm 5) to Ed25519 (algorithm 15).
Key Generation Examples
| |
Key Rotation with dnssec-settime
BIND handles key rotation manually using dnssec-settime:
| |
The BIND toolchain requires careful manual orchestration of timing parameters (-P publish, -A activate, -I inactive, -D delete). A single misconfigured time window can create a DNSSEC validation gap.
HSM Integration
| |
ldns-keygen: The NLnet Labs Tool
ldns-keygen from NLnet Labs offers a more scriptable, Unix-philosophy approach. It’s part of the ldns library, which provides C and Python bindings for DNS operations.
Key Generation
| |
Scripting Key Rotation
ldns-keygen doesn’t have built-in rollover scheduling, but its clean output format makes scripting easy:
| |
Docker Compose for Testing
| |
Knot DNS keymgr: Automated Key Management
Knot DNS’s keymgr takes a declarative approach: you define a policy, and it handles generation, rotation, and cleanup automatically. This is the most operationally mature solution for teams that want minimal DNSSEC key management overhead.
Policy-Based Key Management
| |
Automated Rollover
Knot handles the entire ZSK rollover process without manual intervention:
| |
| |
HSM Integration
| |
Security Comparison
| Aspect | dnssec-keygen | ldns-keygen | keymgr |
|---|---|---|---|
| Private key storage | Filesystem (0600) | Filesystem (0600) | Filesystem or HSM |
| HSM support | PKCS#11 | Via OpenSSL engine | Native PKCS#11 |
| Algorithm deprecation | Manual | Manual | Automatic (policy) |
| Key compromise recovery | Emergency manual rollover | Emergency script | keymgr rollover command |
| Audit logging | System logs | Shell history | Structured JSON logs |
Why Self-Host Your DNSSEC Infrastructure?
Running your own DNSSEC signing infrastructure gives you complete control over your cryptographic material. When you delegate DNSSEC to a managed DNS provider, they hold your private keys — a compromise at the provider level can poison your entire zone. Self-hosting with HSM-backed key storage ensures that only you control the signing keys, and automated monitoring can alert you to any unexpected zone changes.
The operational burden of manual DNSSEC key rotation is one of the primary reasons many organizations still avoid deploying DNSSEC. Tools like Knot DNS’s keymgr eliminate this pain point by automating the entire lifecycle — from initial key generation to emergency rollover — reducing the risk of misconfiguration that can make your domain unreachable. For teams managing dozens of zones, the difference between manual BIND scripts and Knot’s declarative policy approach is measured in hours of maintenance per month.
For a comprehensive comparison of authoritative DNS servers, see our guide to PowerDNS vs BIND9 vs NSD vs Knot DNS. If you’re interested in DNS-layer security beyond DNSSEC, check our guide to DNS firewall and RPZ implementation.
Understanding DNS protocol internals is essential for secure zone management. Our DNS-over-QUIC encryption guide covers the latest transport-layer security improvements for DNS queries.
FAQ
How often should I rotate DNSSEC keys?
ZSK: Every 30-90 days. Frequent rotation limits the impact of key compromise. KSK: Every 12-24 months. KSK rotation requires updating the DS record at your registrar, so it’s a more involved process.
What happens if my DNSSEC keys expire?
DNSSEC keys don’t technically “expire” — validators check signature validity periods, not key expiry. If signatures expire before new ones are published, validators will reject your zone’s responses (SERVFAIL). Always ensure your signer refreshes signatures before the previous set expires.
Can I use Ed25519 for DNSSEC signing?
Yes. Ed25519 (algorithm 15) is supported by all three tools and is the recommended algorithm for new deployments. It offers 128-bit security with smaller keys and faster signing than RSA. Major resolvers (Google Public DNS, Cloudflare, Quad9) all validate Ed25519-signed zones.
How do I validate that my DNSSEC configuration is correct?
| |
What’s the difference between algorithm rollover and key rollover?
Key rollover: Replace the key but keep the same algorithm (e.g., new ECDSA P-256 key). This is routine. Algorithm rollover: Switch from one algorithm to another (e.g., RSA to Ed25519). This requires updating DS records, waiting for propagation, and ensuring all resolvers support the new algorithm. Knot DNS’s keymgr is the only tool that handles algorithm rollovers automatically.
Do I need a Hardware Security Module (HSM) for DNSSEC?
For most self-hosted deployments, filesystem-based key storage with strict permissions (0400) is sufficient. HSMs (including software HSMs like SoftHSM2) become important when: (a) you manage high-value domains, (b) you need compliance (PCI-DSS, FIPS), or (c) you want physical separation between your DNS server and signing keys.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com