Who needs it
The onmicrosoft.com (MOERA) domains are DKIM-signed automatically. Custom domains need DKIM set up. A verified custom domain is not signed with its own key until you do.
Portal: the DKIM tab
Defender portal > Email & collaboration > Policies & rules > Threat policies > Email authentication settings, DKIM tab (security.microsoft.com/authentication?viewid=DKIM).
- Select the domain.
- Publish the two CNAME records it shows, for selector1 and selector2, at your DNS host.
- Set the toggle to Enabled.
Rotate DKIM keys appears only once DKIM is enabled. If it's missing, the domain isn't enabled yet.
This is not in the EAC. Accepted domains there set Authoritative or Internal relay, and Settings > Domains in the Microsoft 365 admin center adds and verifies a domain, but neither turns on signing.
The CNAME targets changed in May 2025
Custom domains added from May 2025 get targets under dkim.mail.microsoft, for example selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft. Custom domains that existed before keep the older selector1-contoso-com._domainkey.contoso.onmicrosoft.com format. Publish exactly what the DKIM tab shows.
PowerShell
- New-DkimSigningConfig -DomainName contoso.com -Enabled $false creates the configuration; add -KeySize 2048 for a stronger key.
- Get-DkimSigningConfig shows Selector1CNAME and Selector2CNAME, the values to publish.
- Set-DkimSigningConfig -Identity contoso.com -Enabled $true turns signing on.
- Rotate-DkimSigningConfig -Identity contoso.com -KeySize 2048 rotates.
Key size and rotation
The default key is still 1024-bit; 2048 is opt-in at creation or at rotation. Gmail accepts 1024 as a minimum and recommends 2048.
A rotation takes four days (96 hours) before the new key signs, tracked in RotateOnDate, SelectorBeforeRotateOnDate and SelectorAfterRotateOnDate. Another rotation can't start while one is in progress, so you can't rotate twice in one week.