Step by step
- Open the Defender portal at
security.microsoft.comand go to Email & collaboration, Policies & rules, Threat policies, Email authentication settings, then the DKIM tab. - Click your domain. The panel that opens shows the two CNAME values under Publish CNAMEs. Copy them exactly.
- At your DNS provider, add two CNAME records: host
selector1._domainkeyand hostselector2._domainkey, each pointing to its value. - Wait a few minutes (sometimes longer), go back to the same panel, and turn on Sign messages for this domain with DKIM signatures. The status should change to "Signing DKIM signatures for this domain".
What the values look like
Microsoft changed the format in May 2025. Domains added since then get values like this:
selector1-example-com._domainkey.yourtenant.n-v1.dkim.mail.microsoft
Domains added earlier keep the old format:
selector1-example-com._domainkey.yourtenant.onmicrosoft.com
The letter before -v1 is assigned by Microsoft and can't be guessed, so always copy the values from the portal. In Exchange Online PowerShell, Get-DkimSigningConfig -Identity example.com | Format-List Selector1CNAME,Selector2CNAME shows the same values.
The mistakes I see most
- Records published, switch left off. The CNAMEs alone do nothing. The status stays at "CnameMissing" or "Valid" with signing disabled until you turn the toggle on.
- Values typed by hand. One wrong character in the long target and signing never starts. Copy and paste them.
- Domain added twice. Some DNS providers add your domain to the end of the host, so the record becomes
selector1._domainkey.example.com.example.com. Enter onlyselector1._domainkey. - Old and new formats mixed. They can't both be used for the same selector. Use whatever the portal shows for that domain today.
1024 or 2048 bits?
Gmail accepts 1024-bit keys and recommends 2048. Microsoft's PowerShell setup defaults to 1024. To move to 2048, run Rotate-DkimSigningConfig -Identity example.com -KeySize 2048. The 2048-bit key goes on the selector Microsoft switches to at this rotation.