Mailbase
FeaturesPricingDocsBlogComparisonsChangelog
Sign inStart free
Home/Blog/DKIM Key Rotation: A Zero-Downtime Runbook
DeliverabilityUpdated July 31, 20269 min read

DKIM Key Rotation: A Zero-Downtime Runbook

A practical, zero-downtime DKIM key rotation runbook with selector inventory, DNS overlap, canary validation, rollback criteria, and old-key retirement.

By Mailbase Team · Target keyword: DKIM key rotation
Padlock representing email security and DKIM — DKIM Key Rotation: A Zero-Downtime Runbook
Photo from Unsplash
On this page
OverviewInventory the real signing estate firstPrepare a new selector instead of editing the live oneCanary the new signature before broad cutoverMonitor by selector, then retire conservativelySeparate routine rollback from emergency compromise responseMake rotation a repeatable controlCommon MistakesSources & Further ReadingRelated guidesFAQRelated reading

Overview

DKIM key rotation replaces a domain's signing key without breaking verification for legitimate email. The safe pattern is not to overwrite a live DNS record in place. Create a new selector and key pair, publish the new public key, verify it from outside your authoritative DNS, move signers to the new selector in controlled stages, retain the old public key while delayed mail can still arrive, and retire the old selector only after monitoring confirms the migration.

A selector is the s= value in a DKIM-Signature header. Receivers combine it with the signing domain in d= to query selector._domainkey.domain. Because selectors let multiple public keys coexist, they are the mechanism that makes a zero-downtime rollover possible. Rotation should cover every sending service, region, stream, and fallback path—not just the provider used by the last test email.

Inventory the real signing estate first

Analytics dashboard on a screen with charts — Inventory the real signing estate first
Photo from Unsplash

Start with messages, not a DNS-zone guess. Sample raw headers from each transactional, lifecycle, newsletter, support, and sales stream. Record the visible From domain, DKIM d= domain, selector s=, algorithm, sending provider, environment, owner, and whether DMARC currently passes through DKIM alignment. Include secondary regions, disaster-recovery providers, and queue workers that may send only during failures.

RFC 6376 uses selectors specifically so a signing domain can maintain multiple keys and phase keys in or out. That flexibility also makes stale selectors easy to forget. Build one row per signer and selector, then reconcile it against provider consoles and DNS. An unknown active selector is an investigation item; an unused record is not proof that its private key is safely retired.

  • Inspect raw headers from every mailstream
  • Map each selector to a named system and owner
  • Confirm the DKIM d= domain aligns with the intended From domain
  • Treat undocumented production selectors as a security finding
Inventory fieldEvidence to collectWhy it matters
Signing identityDKIM d= and visible From domainsConfirms DMARC alignment will survive the change
SelectorDKIM s= from raw production messagesIdentifies the exact DNS key receivers query
SignerProvider, service, region, environment, ownerPrevents a quiet fallback path from keeping the old key
DNS behaviorRecord type, TTL, delegation, DNSSEC statusSets propagation and troubleshooting expectations
Algorithm and sizeProvider-reported key details and DNS recordFlags legacy material that should not be copied forward

Prepare a new selector instead of editing the live one

Glowing network cables converging into a switch — Prepare a new selector instead of editing the live one
Photo from Unsplash

Generate the replacement through the sending provider or your controlled signing service. Choose a new selector that is operationally recognizable without embedding secrets—for example, a provider and rotation epoch. Publish only the public key in DNS; the private key remains in the signer or provider's protected key store. Do not paste private material into tickets, chat, source control, or the DNS record.

Use current cryptographic requirements rather than cloning a legacy key. RFC 8301 updates DKIM algorithm and key guidance, including treating RSA keys below 1024 bits as invalid for signing or verification. Provider support and DNS constraints vary, so follow the provider's supported configuration while ensuring the result meets the current standard. Rotation is the right moment to remove obsolete key material, not reproduce it under a new selector.

  • Never overwrite or remove the current public key during preparation
  • Keep old and new selector records available in parallel
  • Account for negative caching if the selector name was queried before publication
  • Document who can activate and roll back the signer
  1. Create a new selector and key pair in the authorized signing system.
  2. Publish the exact public-key record at the new selector name.
  3. Query the authoritative nameservers and independent recursive resolvers for the new record.
  4. Validate record syntax, selector name, d= domain, algorithm, and key value.
  5. Wait through the applicable DNS caching window before making the new selector the only signing path.

Canary the new signature before broad cutover

Once DNS is visible, activate the new selector for a test or low-risk stream. Send to external mailboxes where you can inspect the received source. Confirm that the DKIM-Signature contains the expected s= and d= values, Authentication-Results reports dkim=pass, and DMARC still passes through an aligned path. A successful provider dashboard test is useful, but it is not a substitute for receiver-side verification.

Expand in stages by signer, region, or mailstream. Keep the old private key available for rollback and keep its public key published throughout the transition. Do not rotate every provider and domain in one maintenance window; independent batches make failures attributable and rollback manageable.

  • Validate at the receiver, not only at the sender
  • Canary both HTML and plain-text or multipart message paths
  • Test mail modified by your normal link, footer, and tracking pipeline
  • Record the exact cutover time for later DMARC and log analysis
GatePass conditionFailure action
DNSNew selector resolves consistently with the expected public keyPause activation and fix publication or delegation
SignatureReceived header shows the intended d=, s=, and algorithmRevert signer configuration
VerificationIndependent receivers report dkim=passInspect canonicalization, key, and message modification
AlignmentDMARC passes with aligned DKIM or the documented alternate pathFix signing domain before expanding
Production canaryNo unexplained authentication regression by stream/providerStop rollout and return that batch to the old selector

Monitor by selector, then retire conservatively

During overlap, measure which selectors are still signing mail. Use sampled raw headers, provider logs, and DMARC aggregate data where available, while remembering that DMARC reports are delayed and aggregated. Segment failures by signing domain, selector, provider, mailstream, and recipient domain. A global DKIM pass rate can hide one old worker or fallback region that never moved.

Retire the old selector only when all authorized signers have stopped using its private key and the longest relevant queue, retry, and message-transit window has passed. DNS TTL alone is not the full waiting period: a delayed message signed before cutover may be verified after cutover. Keep the public key available during that overlap. After retirement, remove or securely destroy old private-key access, update the inventory, and use your DNS/key-management policy to decide whether to remove the record or publish a revoked-key value.

  • Do not delete the old DNS key immediately after cutover
  • Measure adoption per selector instead of relying on an account-wide pass rate
  • Keep evidence from external receiver tests
  • Close the work only after old private-key access is removed
  1. Confirm new-selector signatures and aligned DKIM passes across every mailstream.
  2. Search logs and sampled headers for any message still signed by the old selector.
  3. Wait out DNS caches plus the maximum realistic queue, retry, and delayed-transit window.
  4. Disable and securely retire the old private key before declaring the rotation complete.
  5. Retire or revoke the old public-key record according to the documented DNS policy.
  6. Update the selector inventory, evidence, owner, and next review date.

Separate routine rollback from emergency compromise response

For a routine rotation failure, rollback is straightforward because the old key remains valid: switch the affected signer back to the old selector, verify a new external message, and investigate the new key without deleting either DNS record. Define rollback triggers before cutover, such as receiver-side DKIM failures, wrong d= alignment, a missing selector in one region, or unexpected post-signing modification.

A suspected private-key compromise is different. Returning to the compromised key is not a safe rollback. Activate a known-good replacement selector, stop the affected signer, preserve evidence, revoke or remove the compromised key according to the incident plan, and assess unauthorized use. Coordinate DKIM action with DMARC monitoring, provider credentials, API keys, deployment secrets, and any system that could have copied the private key.

  • Write rollback commands and owners before cutover
  • Do not confuse a propagation problem with a cryptographic failure
  • Treat compromise as an incident, not normal maintenance
  • Preserve logs showing selector use and configuration changes
ScenarioImmediate moveOld key treatment
New DNS record is wrongKeep or restore signing on old selectorLeave valid while fixing DNS
One region cannot load new keyRoll back that region onlyKeep valid during staged repair
Post-signing service breaks signaturesPause expansion and fix message pipelineUse old selector only if that path still verifies
Private key may be compromisedStop affected signer and activate a known-good keyDo not use as rollback; follow incident revocation plan

Make rotation a repeatable control

No internet standard gives every sender one universal calendar interval. Set a rotation policy from your security requirements, provider capabilities, key custody, audit obligations, and operational risk. Also define event-driven rotation triggers: suspected exposure, staff or vendor access changes, provider migration, deprecated algorithms, unexplained signing activity, or loss of confidence in key provenance.

Mailbase does not replace your provider's DKIM signer or DNS controls. Its relevant role is the workflow above delivery: sender-domain setup, scheduled campaigns, analytics, suppressions, and reply handling. When rotating a domain used by Mailbase or a connected useSend deployment, pause risky campaign changes, canary authenticated messages through the real path, and keep transactional and marketing streams separately observable.

  • Assign named owners for signer, DNS, monitoring, and rollback
  • Schedule rotations as controlled changes with evidence
  • Trigger out-of-cycle rotation when key trust changes
  • Review provider fallback paths during every rotation
ControlOwnerCompletion evidence
Selector inventoryEmail/platform ownerCurrent signer-to-selector map
Key generation and custodySecurity/platform ownerProvider or key-store audit record
DNS publicationDNS ownerAuthoritative and recursive query results
Receiver canaryDeliverability/operator ownerRaw headers with DKIM and DMARC pass
Old-key retirementSecurity and email ownersNo old signatures plus revoked private access

Common Mistakes

  • Skipping SPF, DKIM, and DMARC, or assuming they're a one-time setup.
  • Sending real volume from a brand-new, un-warmed domain.
  • Reusing a stale list without re-verifying, so bounces spike.
  • Ignoring complaint rate until a single bad campaign sinks the domain.

Sources & Further Reading

Official docs for current setup details, pricing, and API behavior — verify specifics there, since they change.

RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM

Related guides

More on dkim key rotation and the surrounding deliverability workflow:

unsubscribe and compliance docs
sender domain docs
SPF, DKIM, and DMARC
bounce management
suppression lists
unsubscribe best practices
Mailbase API docs
Try Mailbase free
Send 200 emails a month on us. Paid plans start at €9 — or bring your own useSend for €5.
See plans

FAQ

What is DKIM key rotation?

DKIM key rotation is the controlled replacement of an email domain's signing key. A safe rotation publishes a new public key under a new selector, moves signers in stages, keeps the old selector available during overlap, and retires old private-key access after verification.

Can DKIM keys be rotated without email downtime?

Yes. DKIM selectors allow old and new public keys to coexist. Publish and verify the new selector first, canary receiver-side authentication, cut signers over gradually, and retain the old public key while delayed messages may still be verified.

How long should an old DKIM key remain in DNS?

There is no single safe interval for every sender. Cover DNS caching and the longest realistic queue, retry, and delayed-message transit window, and confirm no authorized signer still uses the old selector before retirement.

Should I reuse the same DKIM selector when rotating a key?

Use a new selector for a controlled rollover. Replacing the key at a live selector can make cached old records disagree with new signatures. Parallel selectors provide clean overlap, staged activation, and straightforward rollback.

What changes if a DKIM private key is compromised?

Treat it as a security incident. Stop the affected signer, activate a known-good replacement, preserve evidence, revoke or remove the compromised key according to your incident plan, and review provider credentials and systems that could access the key.

Related reading

Deliverability7 min read
SPF, DKIM, and DMARC Explained Simply
SPF, DKIM, and DMARC explained in plain English: what each record does, how they work together to authenticate your email, how to set them up, and the common mistakes that break them.
Deliverability7 min read
Email Bounce Management for SaaS Teams
Hard vs soft bounces explained, what causes them, how to handle each, acceptable bounce rates, and why suppressing bounces automatically protects your sender reputation.
Deliverability7 min read
What Is an Email Suppression List?
What an email suppression list is, what belongs on it (unsubscribes, bounces, complaints, manual), why it protects sender reputation and keeps you compliant, and how to manage it.
Deliverability7 min read
Email Unsubscribe Best Practices
Why making unsubscribing easy improves deliverability, how one-click and List-Unsubscribe headers work, what the law requires, and how a preference center reduces opt-outs.
Deliverability7 min read
Email Deliverability Basics for SaaS Founders
Email deliverability explained for founders: the five things that decide whether you reach the inbox — authentication, reputation, list hygiene, engagement, and compliance — and how to monitor them.
Deliverability7 min read
Domain Warmup for SaaS Email: A Practical Guide
How to warm up a new sending domain or IP: why it matters, a week-by-week volume ramp, automated warmup, and how to keep reputation once you're warm.
Mailbase
Product
FeaturesPricinguseSend integrationChangelog
Learn
BlogDocsAPI referenceResources
Compare
ComparisonsAlternatives
Guides
Transactional email servicesSelf-hosted useSend stackSelf-hosted email marketingSPF, DKIM & DMARCEmail deliverability
Legal
TermsPrivacy
© 2026 Mailbase · french-webEmail workflow for builders.