Guides

DKIM key rotation: when and how

24 November 2026

Rotating a DKIM key means publishing a new key under a new selector, switching signing to it, and retiring the old one after mail in transit has been delivered. The selector is what makes this safe: two keys can be published at once, so nothing fails during the switch. Microsoft 365 rotates between its two selectors for you. Google Workspace and Zoho let you add a new selector. The step most often forgotten is the last one, removing or revoking the old key.

Rotation is also when DKIM most often breaks quietly: a new key goes live before its DNS record, or an old record gets deleted while something still signs with it. Watch, the weekly DNS re-check that comes as a 14-day trial with every $129 Snapshot, notices when a selector your domain publishes changes or disappears.

Why rotate at all

Microsoft’s DKIM page puts it simply: for the same reasons you should periodically change passwords, you should periodically change the DKIM key. A key that has been in use for years has had years of exposure. Rotation also gives you a moment to move from 1024-bit to 2048-bit keys.

Other good reasons to rotate now rather than on a schedule:

How selectors make it safe

Receivers look up a DKIM key at selector._domainkey.yourdomain.com, the pattern in RFC 6376 section 3.6.2.1. Each signature names its selector in the s= tag. So a domain can publish key2025._domainkey and key2026._domainkey side by side, and each message is checked against whichever key signed it.

The safe order is always:

  1. Publish the new key under a new selector.
  2. Confirm it resolves in DNS.
  3. Switch signing to the new selector.
  4. Wait for mail signed with the old key to finish arriving. A few days is plenty.
  5. Revoke or remove the old key.

Doing step 3 before step 2 is what causes failures. Removing the old key on the same day as the switch can fail messages still being retried or delivered.

Microsoft 365

Microsoft 365 uses two selectors, selector1 and selector2, published as CNAMEs that point to keys Microsoft hosts. Rotation switches between them, so you do not touch DNS. Microsoft’s page gives the command:

Rotate-DkimSigningConfig -Identity contoso.com -KeySize 2048

In the Defender portal, select the domain and use Rotate DKIM keys at the bottom of the details pane. Microsoft notes:

To see where a domain stands, Microsoft points to Get-DkimSigningConfig -Identity contoso.com | Format-List and its KeyCreationTime, RotateOnDate, SelectorBeforeRotateOnDate, and SelectorAfterRotateOnDate properties. Our guide to Microsoft 365 DKIM covers the setup.

Google Workspace

Google’s DKIM setup page says that if you used a 1024-bit key before, you can switch to 2048-bit when your DNS provider supports it. Generating a new key means a new TXT value to publish. Follow the same order: publish the new record, confirm it with dig, then start authentication with the new key in the Admin console. Google says it can take up to 48 hours for DKIM to start working after you add a key.

If you keep the default google selector, the new key replaces the old one at the same name, so there is no overlap. Using a new selector prefix for the new key lets the old and new keys sit side by side during the switch. If DKIM shows as not authenticating afterwards, see Google Workspace DKIM not authenticating.

Zoho Mail

Zoho’s DKIM page lets you add several selectors to a domain and choose which is the default. To rotate, add a new selector with a 2048-bit key, publish its TXT record, verify it, then make it the default. Zoho’s page does not describe a rotation feature as such, so removing the old selector is a manual step. See our Zoho Mail guide.

Amazon SES and Mailgun

AWS’s Easy DKIM page lets you change the key length between 2048 and 1024 bits, with a limit: you cannot switch to a different length more than once in 24 hours, except for a first downgrade to 1024 in that period. Mailgun’s verification guide notes that after key rotation you may see several DKIM keys listed, some unverified, and that only the key the domain is configured to use needs to be correct in DNS.

For providers that publish DKIM as CNAMEs, rotation usually happens on their side. Your job is to keep the CNAMEs in place and not delete them during a DNS cleanup.

Retiring the old key

Two options once the new key has been signing for a few days:

Revoking is the more explicit of the two. Either way, check first that nothing still signs with the old selector. DMARC aggregate reports can include the selector next to each DKIM result, so a week of reports after the switch usually shows whether the old one has gone quiet. See how to read a DMARC report.

Checklist

  1. Find every selector your domain publishes. Our guide to DKIM failures shows how to read s= from a message.
  2. Note which service signs with each.
  3. For each one you rotate: publish new, confirm, switch, wait, retire.
  4. Move to 2048 bits where the provider and DNS host allow it.
  5. Check DMARC reports a week later for any DKIM failures on the old selector.

Sources