Microsoft 365 · DKIM · CnameMissing
Microsoft 365 DKIM “CNAME record doesn’t exist” (CnameMissing): the fix
The portal insists the CNAME does not exist. The record you added may be real — and still be the wrong record, in the wrong place, or pointing at the wrong target.
This is the error guide for CnameMissing. For the full first-time setup on your DNS host, see the setup guides linked below — this page fixes the error, it does not repeat them.
The fast answer
Do not copy CNAME targets from any blog, video or this page. Open the domain’s details flyout in the Defender portal (Email authentication settings → DKIM tab) or run Get-DkimSigningConfig, copy the two targets exactly as your tenant shows them, and check five things: both selectors exist, both are CNAMEs (not TXT), the host names are not doubled, the CNAMEs are not proxied, and the targets match your tenant’s format — including the post-May-2025 format for newer domains. One of those five is almost always the answer.
What you are looking at, in plain words
Microsoft 365 DKIM works with two CNAME records, selector1._domainkey and selector2._domainkey, that point at Microsoft-hosted public keys for your tenant. The Defender portal reports CnameMissing when it cannot find those CNAMEs resolving to the expected targets. The confusing part is that the portal’s own wording (“CNAME record doesn’t exist”) covers all of these: no record at all, a TXT record where a CNAME should be, a host name typed with the domain twice, a proxied CNAME that resolves to something else, and — since May 2025 — a target built from an old example instead of your tenant’s current format. A missing selector2 on its own is the exception: signing can still enable, and the failure surfaces later when key rotation fails — see the table. Work the table below in order; do not re-create records blindly until you know which row you are in.
| What you probably did | What the portal sees |
|---|---|
| Published the public key as a TXT record | No CNAME → CnameMissing |
| Created selector1 only | Signing can still enable — but key rotation fails later; Microsoft requires both records |
| Typed the full host with domain twice | Record lives at a doubled name nobody queries |
| Left the Cloudflare proxy on | Lookups return Cloudflare addresses, not the Microsoft target |
| Copied an old onmicrosoft.com target | Target does not match your tenant’s expected value |
Step 0 — Prove which part is failing
- In the Defender portal, open Email authentication settings → DKIM tab, click your domain, and read the status and the Publish CNAMEs section. Write down both targets exactly as shown — these, not any example, are authoritative for your tenant.
- Query both selectors from outside:
dig CNAME selector1._domainkey.yourdomain +shortand the same for selector2. Note what each returns: nothing, a TXT-style value, a Cloudflare address, or a Microsoft target. - Compare the two dig answers with the two portal targets, character for character. The mismatch — not the portal message — is your diagnosis.
Fix 1 — Create both CNAMEs, exactly as your portal shows them
At your DNS host, create two CNAME records: host selector1._domainkey pointing at the selector1 target from your flyout, and host selector2._domainkey pointing at the selector2 target. If your host appends your domain automatically (GoDaddy and many others do), enter only selector1._domainkey — entering the full selector1._domainkey.yourdomain creates a doubled name. Set TTL to at least 3600 on both, as Microsoft specifies. Then wait: Microsoft says detection takes a few minutes, or possibly longer.
Fix 2 — Use the right target format for your domain’s age
Domains added after May 2025 use a new target format ending in dkim.mail.microsoft, shaped like selector1-yourdomain-com._domainkey.<your-prefix>.<partition>-v1.dkim.mail.microsoft, where the partition character is assigned by Microsoft and is not guessable. Older domains and initial domains keep the old format ending in onmicrosoft.com. The two formats cannot be mixed for the same selector, and an old-format target hand-built for a new domain will never validate. If you are unsure which format your domain uses, do not guess from the examples: read it from your flyout or from Get-DkimSigningConfig -Identity yourdomain | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME in Exchange Online PowerShell.
Fix 3 — Unproxy the CNAMEs and remove the TXT impostor
If the CNAMEs sit behind Cloudflare, set them to DNS-only (grey cloud). A proxied CNAME answers queries with Cloudflare addresses, so Microsoft never sees its key. And if you previously created a TXT record at a selector name, delete it: a name cannot be both a CNAME and a TXT record, and the TXT record can block the CNAME from working at all. After each change, re-run the two dig queries before returning to the portal.
Fix 4 — Enable signing only after the portal sees both CNAMEs
Return to the domain flyout and switch on Sign messages for this domain with DKIM signatures. Success looks like toggle Enabled and status “Signing DKIM signatures for this domain”. If the toggle still errors, re-check Step 0 — the portal checks the records, not your intentions, and a single mistyped character in a target is enough to keep the status at CnameMissing. Copy, never retype, the targets.
Prove it worked
- Both dig queries return exactly the two targets from your portal flyout.
- The portal status changes from CnameMissing to “Signing DKIM signatures for this domain” with the toggle Enabled.
- Send mail to an outside mailbox and confirm
dkim=passwithheader.d=yourdomain(not an onmicrosoft.com domain).
Still not working? Work this ladder in order
- One selector resolves, the other does not. You created one record. Create the second — Microsoft requires both records, and without selector2 key rotation fails later even if signing enables.
- Both dig answers look right but the portal still says CnameMissing. Wait longer — Microsoft notes DNS propagation can take a few minutes to 48 hours — then check for a doubled host name or a proxied CNAME — the two most common “looks right” traps.
- Targets end in onmicrosoft.com but your domain is new. You copied an old example. Replace both targets with your flyout’s values (Fix 2).
- A pasted target looks wrong in the panel. Dashes, periods and underscores are easy to mistype — Microsoft’s own note is to check for typos in the values. Re-enter by copying from the flyout in small pieces and verify with dig, not by eye.
Mistakes that make it worse
- Publishing a TXT key instead of two CNAMEs.
- Creating only selector1.
- Copying CNAME targets from a blog, video or another tenant’s screenshot.
- Leaving the CNAMEs proxied, or typing the domain twice in the host field.
FAQ
Why does the portal say the CNAME doesn’t exist when I can see it in my DNS panel?
Because the portal queries public DNS for a CNAME at the exact selector name pointing at your tenant’s expected target. A record at a doubled name, a proxied record, a TXT record, or a target for a different tenant all fail that query while looking present in your panel.
What changed in May 2025?
Microsoft introduced a new DKIM CNAME target format ending in dkim.mail.microsoft for newly added custom domains, with a Microsoft-assigned partition character. Existing domains kept the old onmicrosoft.com format. The formats cannot coexist for one selector, so old examples are actively wrong for new domains.
Should I use the portal or PowerShell to get the targets?
Either — both show your tenant’s authoritative values. The portal flyout’s Publish CNAMEs section and Get-DkimSigningConfig agree; a blog post does not.
Sources
Microsoft Learn — How to use DKIM for email in your custom domain (CNAME syntax, May 2025 format, CnameMissing flow, Get-DkimSigningConfig, TTL 3600) · Merroway setup guides (not duplicated here) — Microsoft 365 DKIM on Cloudflare · Microsoft 365 DKIM on GoDaddy.
Did this fix work for you?
Your reaction is stored only in your own browser — it is not sent to us.