Email authentication error
Rotating DKIM keys and selectors without breaking your mail
A DKIM private key sits on a mail server or with a sending service, and it can stay in use for years. The longer one key is in use, the more places it has been copied, and the more people who have had access to it have come and gone. Rotation means replacing it on purpose, before anything goes wrong.
By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.
Done in the right order, rotation is invisible to your customers. Done in the wrong order, it makes every message fail DKIM until someone notices. RFC 6376 builds the mechanism in through selectors, and this page shows how to use them.
Why selectors make rotation safe
A DKIM signature names its key with a selector, and the public key is published in DNS under that selector. Because the selector is part of the name, two keys can exist side by side: the old one at one selector and the new one at another. Signers choose which one to use, and receivers fetch whichever one the signature names.
That gives you an overlap period. Publish the new key first, switch signing to it, then retire the old one only after mail signed with it has had time to be delivered and checked. RFC 6376 section 3.6.2 describes this arrangement.
The order of steps
First, generate a new key pair and choose a new selector, for example one that includes the year. Second, publish the new public key in DNS and test that it can be looked up. Do not touch the signer yet. Third, change the signer to use the new selector and private key, and send test messages to confirm dkim=pass.
Fourth, leave the old public key in place for a period after the switch. Messages signed just before the change may sit in queues, be delayed by greylisting, or be re-checked later by a receiver, and they need the old key to verify. A few days is a common choice, though the standard sets no figure. Fifth, remove the old record. Removing it earlier, or overwriting it with the new key under the same selector, is the usual way rotation breaks mail.
When to rotate
There is no mandated schedule in the standard. Reasonable triggers are a fixed interval chosen by your IT provider, a staff member or supplier with key access leaving, a suspected leak of the private key, or a move to a new mail platform. Rotate straight away if you suspect the key has been exposed, and also remember to publish the old key as revoked by setting an empty p= value, so nobody can use it to forge signatures.
If a sending service manages your key through a CNAME record, it normally rotates the key for you, and your job is only to keep the CNAME in place. Ask the vendor how often it does this.
What to record
Keep a small register: each selector, the service that signs with it, the key length, the date it was created and the date for review. When a selector appears in a failing message, the register tells you who owns it. Consider whether the new key should also be longer, which our page on 1024 versus 2048 bit keys covers.
Rotate a DKIM key safely
- List every selector now in use and which service signs with each.
- Generate a new key pair and pick a new, dated selector name.
- Publish the new public key in DNS and confirm it can be looked up.
- Switch the signer to the new selector and private key.
- Send tests to outside mailboxes and confirm dkim=pass with the new selector.
- Keep the old public key published for several days after the switch.
- Check DMARC reports for any DKIM failures from your own sources.
- Remove the old record, or publish it with an empty p= if it may have leaked.
- Update your selector register with dates and owners.
- Set the next review date in the calendar.
Questions people ask
How often should DKIM keys be rotated?
The standard sets no schedule. Pick an interval your IT provider can keep to, and rotate at once after a suspected leak or when someone with access leaves.
Can I reuse the same selector with a new key?
It works only if you can swap the DNS record and the signer at the same instant, which you cannot. Using a new selector gives you an overlap and avoids a window of failures.
What happens to mail signed with the old key?
It verifies as long as the old record is still published. Remove the record too soon and delayed messages fail.
Does my email service rotate keys for me?
Some do, particularly when you publish a CNAME that points to their key. Check the vendor's help pages and keep the record in place.
Where to from here
The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.
Sources
- RFC 6376, DomainKeys Identified Mail (DKIM) Signatures, sections 3.6.1 and 3.6.2
- ASD, how to combat fake emails
- RFC 7489, DMARC
General information, not legal advice. Laws and guidance change: check the linked primary sources and ask a qualified adviser about your own situation. Written by Kyle Deligny with AI assistance, last reviewed 1 December 2026. How we write and check: editorial policy.
