CertaDNS
Skip to lesson

Key Rotation · lesson 3 of 3

Rotations that lose mail

After this lesson you can

Name the four ways a rotation destroys signatures, and the check that catches each.

Assumes you have read The overlap window.

Every way a rotation loses mail is a step done out of order. Four of them account for nearly all real incidents.

The four

MistakeSymptomThe check that catches it
Signing with the new key before its record resolvesSudden DKIM failures at a subset of receivers, resolving on their own over the TTLQuery the new selector from a resolver you do not control before switching.
Revoking the old selector immediately after switchingFailures on mail sent days ago, concentrated at receivers that were deferringWait out the retry window. Revoking is never urgent unless the key leaked.
Replacing the key in place at the same selectorIntermittent failures for the length of the TTL, with no pattern by receiverUse a new selector. There is no reason to reuse one.
Rotating one signer of severalOne mail stream fails while others pass; usually noticed weeks laterInventory every system signing as the domain before starting.

Verifying before you switch

The publish step is complete when the record answers from somewhere outside your own infrastructure, not when your DNS provider’s console shows it saved:

$ dig +short TXT mktg202609._domainkey.example.com @1.1.1.1
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB..."
An empty answer here means do not proceed, whatever the console says.

If your zone has secondaries, check each of them. A record present on the primary and absent from one secondary produces exactly the symptom in the first row — failures at a fraction of receivers, apparently at random.

Verifying after

Send a message through the rotated path and read the delivered headers. The DKIM-Signature should name the new selector and Authentication-Results should report dkim=pass. Both, not either: the first proves the signer switched, the second proves the record works.

A rotation is not finished until the old selector is revoked

The half-finished rotation — new key live, old key still published and still valid — is the most common state to find a domain in, and it has the security properties of not having rotated. Put the revocation in the calendar at the moment you switch, dated for the end of the drain window.

Knowledge check

You rotate to a new selector, switch the signer, and revoke the old selector the same afternoon. What fails, and where?

Try it on a real domain

Free, no account, public DNS only.

Last reviewed