Skip to content

Rotating DNSSEC keys on cPanel without an outage

DNSSEC key rotation has to overlap old and new keys for the previous TTL window. Here is the safe sequence for cPanel zones and the DS handoff with the registrar.

The fastest way to break DNSSEC is to rotate the KSK and update the DS at the registrar in the wrong order. Validating resolvers caching the old DNSKEY for one TTL still expect the old key to be valid; if you have already removed it server-side, they get a bogus chain and return SERVFAIL. The rotation has to be a controlled overlap, not a swap.

What’s happening

A KSK rotation involves three states that have to overlap correctly:

  • The zone has only the old KSK signing it; the registrar has the old DS.
  • The zone has both keys (old and new) signing; the registrar still has the old DS, but the new key is available for the next step.
  • The registrar has both DSes; the zone has both keys.
  • The registrar has only the new DS; the zone has only the new KSK signing.

Skipping the overlap — going directly from “old only” on the server to “new only” without telling the registrar — leaves any resolver with a cached DNSKEY pointing to a key that no longer signs. Rotation has to allow at least one full TTL of the DNSKEY for resolvers to fetch both keys before the parent transition.

How to verify

Before starting, capture the current state:

dig +short DNSKEY example.com
dig +short DS example.com
whmapi1 fetch_ds_records_for_domains domain=example.com

Note the key tag (the first number in the DS) of the current KSK. After the rotation, the new key must have a different tag.

During the overlap window:

dig +multi DNSKEY example.com

You should see two KSK records (flag 257) with different tags. If you only see one, the new key has not been added yet.

After the registrar update:

delv example.com
dig +dnssec example.com | grep -i ad

delv should say ; fully validated. The ad flag confirms the resolver got a valid chain.

The fix

  1. Generate a new KSK on the server without removing the old one. In WHM > DNSSEC, use the “add key” action, not “regenerate”. The zone now signs with both KSKs.
  2. Wait for the DNSKEY TTL to pass (default 3600). Verify that public resolvers return both keys with dig +short DNSKEY example.com @1.1.1.1.
  3. Publish the new DS at the registrar alongside the old one. Both DSes are now live at the parent; both keys are live in the zone.
  4. Wait for the parent DS TTL to pass (typically 3600 for most TLDs, sometimes longer — .com is 86400 for cached entries via Verisign). During this window, validating resolvers can chain through either key.
  5. Remove the old DS at the registrar. Wait again for the DS TTL.
  6. Remove the old KSK on the server, leaving only the new one. The rotation is complete.

The ZSK rotation is simpler — cPanel can do it automatically without a registrar handoff because the chain anchors on the KSK, not the ZSK. Set a quarterly schedule for ZSK rotation and annual for KSK.

If the registrar publishes DS records by self-service, this is a 30-minute task with a 24-hour clock. If the registrar requires a support ticket, build in a 48-hour buffer and do not start the rotation before the change window. Stack Harbor handles DNSSEC key lifecycle including registrar coordination as part of cPanel/WHM management.