A standard DKIM key rotation follows a strict order: publish the new public key first, switch outbound signers to use it, verify signatures on delivered mail, and only then decide when the old public key can go. This procedure assumes the existing private key remains secure. If you suspect key exposure or compromise, jump immediately to the incident branch at the end of this guide; routine selector overlap is unsafe for compromised keys.
Assign responsibilities and agree on rollback paths
Designate a single change owner alongside the engineers authorized to modify DNS zone files and sending platform settings. In your change record, document the exact signing domain, affected sending services and background workers, the current selector with its complete DNS record, the proposed replacement values, and references to approved signer configurations. Store private cryptographic keys strictly inside your secure key management infrastructure, never in tickets or ticket comments.
Map out how each service handles mail queuing, when messages receive signatures, how long delivery retries persist, and which external mailboxes you’ll use for test sends. Confirm supported recovery capabilities with your vendor before modifying production systems. Operational permissions and recovery paths differ widely by platform: Google’s setup instructions, for instance, mandate super-administrator privileges for key creation and Gmail Settings management, and do not promise that a previous private key can be restored. Resolve that uncertainty with your provider before you go further.
Overlap selectors: publish new keys while legacy signers remain active
For self-managed infrastructure, provision a new selector supported by your mail software and publish its public key without altering or deleting the existing record. Because a signature uses s= and d= to locate selector._domainkey.signing-domain, running distinct selectors lets verifiers access both public keys simultaneously. Operating overlapping selectors does not require attaching dual signatures to individual outbound messages. RFC 6376 details foundational DKIM selector mechanics. If you want to analyze signature tags in depth, review the guide covering the anatomy of a DKIM-Signature header, while the deliverability practical notes summarize baseline mechanics.
For Microsoft 365 custom domains, maintain both CNAME selector slots configured in your tenant. Never replace these with manual TXT records and never delete the inactive selector; follow the managed workflow outlined in Microsoft’s CNAME guidance. Microsoft’s rotation documentation defines a 96-hour transition window tracking RotateOnDate, during which initiating a subsequent rotation is blocked. This timeframe reflects vendor-specific automation rather than an Internet-wide retention interval or an instant rollback switch.
Validate authoritative DNS records and public recursive resolver responses against your intended configuration, tracing any CNAME alias down to its target public key. Record query timestamps, returned values, and TTL parameters alongside platform validation status. In TXT record syntax, multiple quoted character strings within a single resource record are concatenated, whereas publishing multiple distinct TXT records under identical selector names yields undefined verifier behavior. Review the DKIM TXT record rules to prevent syntax errors.
Do not switch outbound signing while the new selector record remains missing, malformed, or unresolved. Positive records have cache lifetimes, while NXDOMAIN or NODATA answers can be cached negatively by recursive resolvers; those negative answers are different from transient DNS errors. Querying a selector successfully from your workstation does not prove global resolver availability, and no universal timer guarantees DNS propagation is complete.
Verify the new selector on delivered messages
After verifying DNS propagation and platform readiness, activate signing on the new selector while keeping both public keys published. Send test emails from every affected sending stream to external mailboxes you control. Inspect the raw source of the delivered email to confirm that the expected d= domain and new s= selector produce a valid DKIM pass.
Evaluate only the Authentication-Results header generated by the receiving system under inspection, because intermediate hops can insert forged headers; the results trust boundary matters as much as the result text. Receivers may report the selector as header.s, but it may be absent. If multiple signatures or sparse diagnostic headers obscure which key was validated, collect verbose server diagnostics or send an isolated test message. Never attribute another signature’s passing status to your new selector.
Use the decision table below to determine whether to proceed. Return values including fail, temperror, and permerror reflect standardized DKIM result definitions.
| What you observe | Decision and next action |
|---|---|
| The intended new selector passes at the trusted recipient | Record the evidence for this path and test the remaining paths. |
| A fresh message still uses the old selector | Check for a scheduled provider switch or a signer that missed the change; the rotation is unproven. |
The new signature returns fail or permerror | Stop and inspect the diagnostics; these results do not point to one universal cause. |
The new signature returns temperror | Investigate the likely transient verification problem and repeat the check. |
| The result is missing or cannot be assigned to the new signature | Get clearer evidence. Missing reporting alone does not prove the mail was unsigned. |
Confirm domain alignment with your visible sender address, and evaluate DMARC as an independent operational check. Because an aligned SPF pass or a separate valid DKIM signature can yield dmarc=pass, a passing DMARC evaluation does not confirm that your new DKIM key functions correctly; this distinction stems directly from RFC 9989’s authentication model. Follow the DMARC alignment diagnosis guide to isolate alignment defects. Passing cryptographic checks also does not promise inbox placement.
Accounting for queued messages and delayed signers
The scenario below is fictional. An organization runs notify.example.com using selectors ops-old and ops-next across an API service and a background worker. Both public keys resolve in DNS, and external test mailboxes identify incoming signature selectors.
| Invented observation | What it means and what to do |
|---|---|
Fresh API mail carries d=notify.example.com, s=ops-next; the receiver reports dkim=pass header.d=notify.example.com header.s=ops-next. | This API sample verifies the new key. Check the worker next. |
Mail signed before the switch arrives later with s=ops-old and passes. | Delayed arrival still needs the old public key, so retain it. |
A fresh worker message is signed after the intended switch with s=ops-old and passes. | The worker has not switched. Its owner must switch it and retest, then revise the evidence for the last old-key signature. |
An authentication failure on the new selector halts the entire migration even if SPF generates a passing DMARC outcome. Gather server logs and header traces before attempting corrective rollback.
When can the old DKIM public key be deleted?
Confirm that every outbound signing service has transitioned, and identify the exact timestamp when the legacy key signed its final message. Account for messages that were signed before queuing, downstream retry delays, and deferred mailbox verification. A queued job that is signed only when it is released has different dependencies from a queued message already carrying the old signature, and DNS cache expiry settles neither case.
Pick a waiting period that accounts for your queue retry windows and get agreement from the team running the service. If you aren’t sure how the queue or the signing behaves, keep the old public key during a routine rotation and ask the service. DKIM’s delayed-validation guidance defines no mandatory retention window, and passive monitoring cannot confirm that archived messages will never face reverification. Remove only self-managed records whose retirement conditions are satisfied, then confirm ongoing production signing. Microsoft’s required CNAME slots stay.
If the rotation encounters unexpected failures, revert outbound signing to the previous key only if that key remains uncompromised and the provider supports restoration. Validate fresh delivered test mail, and keep both public keys active in DNS for the duration of the verification window to protect in-flight messages signed by either key. If key restoration is unsupported by the platform, pause outbound transmission where feasible and follow provider recovery steps. Disabling DKIM signing does not restore an earlier key.
If you suspect private key compromise, cease using the key immediately and treat revocation as a critical security incident. Do not apply standard selector overlap and never roll back to the exposed key; doing so allows attackers to sign forged email under your domain. RFC 6376’s provisions on compromise and revocation consequences both mean accepting that legitimate mail not yet verified may fail too. On a hosted platform, revoke the key through the provider. Either way, cached DNS answers rule out an immediate worldwide effect.
Technical sources checked 9 September 2026. No tenant, DNS change or message test was performed for this article, and publication of a standard does not establish receiver adoption. Document operational evidence and retirement decisions within the DNS change record.
Frequently asked questions
Does selector overlap require dual signatures on every email?
No. Separate selectors allow both public keys to exist in DNS concurrently without requiring double signatures on individual messages. Senders sign with one active selector while verifiers validate either.
Can a passing DMARC verdict confirm the new DKIM selector works?
No. A passing DMARC result can stem from aligned SPF or an alternative DKIM signature rather than your new selector. You must inspect the specific selector in received headers directly.
How long should the retired DKIM public key remain published?
RFC 6376 specifies no universal duration for delayed validation. Write down the validation interval you have justified locally and the owner’s decision, and remove only a self-managed old record whose retirement conditions are met. If you don’t know how the queue or the signing behaves, keep the old public key during a routine rotation and get guidance from the service.
What should you do if an active DKIM private key is compromised?
Revoke the affected key immediately and treat the rotation as an active security incident. Do not use standard selector overlap or revert to the exposed key, because it can enable abuse signed with your domain.
Does toggling DKIM off in a provider portal restore the previous key?
No. Disabling signing halts DKIM generation rather than restoring previous key configurations. If a migration fails and recovery is unsupported, pause outbound streams and follow provider emergency steps.


