Microsoft 365 DKIM CNAME Missing in Cloudflare? How to Fix It
Short answer
First check whether Microsoft has generated the two custom-domain targets. Publish those exact targets as DNS-only CNAMEs in Cloudflare and look up both selectors publicly. If either lookup fails or shows a different target, fix the record before retrying the toggle in Microsoft Defender.
By Xpoudy ·
Identify which part failed
| What you see | First thing to check |
|---|---|
| No keys to copy in Defender | Open the correct custom domain and generate the DKIM keys if prompted |
| No public CNAME for one selector | Check the name, authoritative zone and proxy status |
| A public CNAME with a different target | Compare it character by character against Defender for this domain |
| Both CNAMEs show the correct targets | Check the published answers across resolvers and allow for Microsoft to detect the records |
Check the absolute names. For example, the left-hand name is selector1._domainkey.example.com for a root custom domain. For a sending subdomain it must include that subdomain. A record entered in the wrong Cloudflare zone can look plausible in the dashboard and still never answer on the public hostname.
Verify both records as CNAMEs
In Cloudflare, look for old records at the same names and check that each selector is DNS-only. In Xpoudy’s DNS Propagation Checker, query the fully qualified hostname and choose CNAME. Compare results for selector1 and selector2, then compare them with the exact values shown in Microsoft Defender.
If answers disagree, record which resolvers show the old values and check the old TTL. Repeatedly deleting and recreating working records makes it harder to compare. If the DNS is correct and Defender still refuses to activate, capture the timestamp, both hostnames and the DNS results for Microsoft support.
Confirm the fix on a fresh message
Enable DKIM once Defender accepts the records. Send a brand-new test email and inspect the receiving server’s headers. Make sure the signature uses the intended From domain and note the selector it used. Leave both published selectors in place so Microsoft can rotate keys.