Guides
Microsoft 365 DKIM will not enable: fixes
14 November 2026
When Microsoft 365 will not turn on DKIM for a custom domain, the status usually says CnameMissing. That means Microsoft has created the keys but cannot find the two CNAME records, selector1._domainkey and selector2._domainkey, in your DNS. Publish both exactly as the Defender portal shows them, wait for Microsoft to detect them, then turn signing on. If the status says NoDKIMKeys instead, create the keys first.
The full Microsoft 365 setup, including SPF and DMARC, is in our Microsoft 365 guide. This page is for when the toggle will not stay on. For an outside check of the records, a $129 Snapshot reads both selectors from public DNS along with SPF and DMARC.
Where to look
Microsoft’s DKIM configuration page puts the settings in the Defender portal under Email & collaboration, Policies & rules, Threat policies, Email authentication settings, on the DKIM tab. The direct address is https://security.microsoft.com/authentication. Select your domain to open its details.
The page describes three status values:
NoDKIMKeys, shown as "No DKIM keys saved for this domain": no keys exist yet.CnameMissing: keys exist, but the CNAME records were not found.Valid: the configuration works.
When signing is on, the details show the toggle as Enabled and the status as Signing DKIM signatures for this domain.
NoDKIMKeys: create the keys
Microsoft’s page shows a Create DKIM keys button for this state. Click it, or use Exchange Online PowerShell:
New-DkimSigningConfig -DomainName contoso.com -Enabled $false
Microsoft’s page says -KeySize takes 1024 or 2048, and that 1024 is the default. Add -KeySize 2048 if you want the longer key from the start. Because Microsoft uses CNAMEs, you do not paste a long key into your own DNS, so the 255-character limit does not apply.
CnameMissing: publish the two CNAMEs
Microsoft’s page describes a deliberate step here. When you first try to enable DKIM, a Client error dialog opens that contains the CNAME values. Click OK, and the status becomes CnameMissing with the toggle still off. Copy the values from the Publish CNAMEs section of the domain details.
The records follow this pattern, per Microsoft:
Hostname: selector1._domainkey
Points to: selector1-<CustomDomainWithDashes>._domainkey.<InitialDomainPrefix>.<DynamicPartitionCharacter>-v1.dkim.mail.microsoft
Hostname: selector2._domainkey
Points to: selector2-<CustomDomainWithDashes>._domainkey.<InitialDomainPrefix>.<DynamicPartitionCharacter>-v1.dkim.mail.microsoft
Microsoft explains the parts: your domain with dots replaced by dashes (contoso.com becomes contoso-com), the custom part of your onmicrosoft.com domain, and a character Microsoft generates that you cannot choose. Microsoft also says the values in its article are for illustration only. Always copy yours from the portal or from PowerShell:
Get-DkimSigningConfig | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME
Check the record at your DNS host
- Both records. Microsoft needs
selector1andselector2. One is not enough. - Type CNAME. Not TXT.
- The Name field. Enter
selector1._domainkey, not the full name, at hosts that add your domain. Otherwise the record lands atselector1._domainkey.contoso.com.contoso.com. - The target. Copy the whole value. Do not reuse a value from a blog post or from another tenant.
- Cloudflare. Set the CNAMEs to DNS only. A proxied record answers with Cloudflare’s addresses instead of pointing to Microsoft.
- The right zone. Run
dig NS contoso.com +shortand edit DNS at the host it names.
Our guide to adding a DKIM record covers the Name field at common hosts.
Confirm it from outside
dig CNAME selector1._domainkey.contoso.com +short
dig CNAME selector2._domainkey.contoso.com +short
Each should return the Microsoft target. If you get nothing, Microsoft will not find it either.
Wait, then enable
Microsoft says it takes a few minutes, or possibly longer, to detect new CNAMEs. Its troubleshooting notes say DNS propagation can take from a few minutes to 48 hours, depending on your provider and TTL, and list a status still at CnameMissing after 48 hours as the point to investigate.
Once the records are found, open the domain details and turn on Sign messages for this domain with DKIM signatures. In PowerShell:
Set-DkimSigningConfig -Identity contoso.com -Enabled $true
Microsoft says that if the CNAMEs still are not detected, this command returns an error with the values to use. Check for typos, wait a while longer, and run it again. When it works, Get-DkimSigningConfig shows Enabled as True and Status as Valid.
Enabled, but mail still fails DKIM
- The message was sent from a different domain. DKIM signing is per domain. Mail from a second custom domain needs its own pair of CNAMEs and its own toggle.
- Something changed the message after signing. A third-party gateway that adds a footer after Microsoft 365 breaks the body hash. See DKIM fail.
- A rotation is in progress. See below.
Test by sending to a Gmail address and reading the Authentication-Results line. You want dkim=pass with your domain in header.d or header.i.
Key size and rotation
Microsoft’s page says you can change to 2048-bit keys with:
Rotate-DkimSigningConfig -Identity contoso.com -KeySize 2048
It also warns that changing from 1024 to 2048 applies only to the next active selector on the first rotation. The other selector moves to 2048 on the following rotation. Rotation is not instant: Microsoft says it takes four days (96 hours) for the new key to start signing, and you cannot start another rotation while one is in progress. Because you published CNAMEs, rotation needs no DNS change on your side.
Checking where a domain stands
For a quick read of every custom domain at once, run Get-DkimSigningConfig with the Format-List command shown earlier. For one domain in more detail:
Get-DkimSigningConfig -Identity contoso.com | Format-List
Microsoft’s page points to these properties for rotation: KeyCreationTime, RotateOnDate, SelectorBeforeRotateOnDate, and SelectorAfterRotateOnDate. They tell you which selector is signing now and when the last rotation happened.
Microsoft also says rotation needs the toggle at Enabled and the status at Valid or CnameMissing. If a rotation will not start, check those two first.
A short checklist for a domain that will not enable:
- Status says
NoDKIMKeys: create keys. - Status says
CnameMissing: publish both CNAMEs exactly, check them withdig, and wait. - Still
CnameMissingafter 48 hours: look for a doubled name, a proxied record, or the wrong DNS zone. - Records found: turn on signing and confirm the status reads
Valid.
Next: DMARC
With DKIM signing as your domain, Microsoft 365 mail can pass DMARC through DKIM, which survives forwarding better than SPF. If you have not published DMARC yet, start at p=none with reports. See DMARC record tags.
Sources
- Microsoft Learn: Set up DKIM to sign mail from your Microsoft 365 domain (portal steps, status values, CNAME format, PowerShell, key size, rotation, timing)
- RFC 6376: DKIM