Check SPF, DKIM, and the header chain first. If the message shows dkim=fail, dkim=permerror, or no signature, fix the DNS CNAME for the active selector, confirm the tenant domain is enabled for DKIM, then retest outbound mail. Ignoring the failure can break DMARC alignment and send legitimate mail to junk or rejection. This guide maps the exact header symptom to the Microsoft 365, DNS, or mail-flow change that caused it.
What you'll need
- A copy of the raw message headers from a failed message.
- Access to the Microsoft 365 Defender portal.
- DNS access for the domain that signs mail.
- A command prompt or terminal with
nslookup. - A fresh test message sent after each change.
DKIM triage table
| Header symptom | Likely cause | Exact Microsoft 365 check | DNS check | Pass/fail re-test command |
|---|---|---|---|---|
dkim=none in Authentication-Results |
No signature was present, or Exchange Online was not the signer. | Microsoft 365 Defender portal > Email & collaboration > Email authentication settings > DKIM tab; confirm the domain is enabled. | Check whether the active selector exists at selector._domainkey.domain. |
Send a fresh message, then inspect new headers for dkim=pass or a signed result. |
dkim=fail with selector text in the header |
Selector mismatch, missing CNAME target, revoked key, or body change after signing. | Verify the signing domain in the DKIM tab matches the domain in d=. |
Confirm selector1._domainkey and selector2._domainkey resolve to the expected Microsoft targets. |
Resend after the DNS fix, then compare the new Authentication-Results line. |
body hash did not verify |
The body changed after signing. | Review transport rules, disclaimers, and connectors that alter the message after submission. | DNS is usually fine; check the selector only if the message was signed by a different service. | Send a message that bypasses the modifying rule, then recheck headers. |
dkim=pass but DMARC fails |
DKIM passed, but d= is not aligned with the From domain. |
Confirm the signing domain in d= is the same organizational domain used in From. |
Confirm the published selector belongs to that aligned domain. | Re-test with the aligned sending domain and read both Authentication-Results entries. |
Why is Exchange Online DKIM failing?
Most failures come down to one of four things: the message was not signed by Exchange Online, the active selector does not match the published DNS record, the message body changed after signing, or the signing key expired or was removed too soon. If the result is dkim=none, start with signing. If it is dkim=fail, start with the selector and body hash.
Read the header wording first
Open the raw headers and find Authentication-Results. That is where the receiver records dkim=pass, dkim=fail, dkim=neutral, or dkim=none. Then inspect DKIM-Signature for d, s, h, bh, b, c, t, and x. Those fields show the signing domain, selector, signed headers, body hash, signature value, canonicalization, timestamp, and expiry.
When Exchange Online is not the signer
A hybrid route or third-party relay can sign mail before or after Exchange Online handles it. In that case, the fix sits outside Microsoft 365 DKIM settings. Look for the outbound connector, secure mail gateway, or external relay that added the signature, then check its selector and DNS record instead of changing the Microsoft 365 domain toggle.
DKIM pass versus DMARC fail
dkim=pass does not guarantee DMARC pass. DMARC also checks alignment, so a signed message can still fail when d= does not align with the From domain. That matters after domain migrations, tenant consolidation, and rebranding, when the signer keeps using an old domain even though the visible sender has changed.
How do I check the DKIM selector in Exchange Online?
Look at the s= value in DKIM-Signature, then verify that selector in DNS at selector._domainkey.domain. If Exchange Online is the signer, Microsoft 365 appears to use the domain-level DKIM setting, and the tenant needs two selector CNAME records in place before signing can be enabled.
- Open the DKIM tab. Go to the Microsoft 365 Defender portal, then the Email & collaboration area, then Email authentication settings, then DKIM. If the menus move, search for the DKIM settings page rather than relying on a fixed path.
- Match the selector name. Compare the header’s
s=value with the published selector hostnames. Microsoft 365 commonly usesselector1._domainkeyandselector2._domainkey. - Check DNS resolution. Run
nslookup -type=cname selector1._domainkey.yourdomain.comand repeat for selector2. Confirm the answer points to the Microsoft target for that tenant. - Enable signing for the domain. Turn on DKIM only after both selector CNAMEs resolve correctly. If the records are missing, disable signing until DNS is complete.
Say your headers show s=selector1 but the DNS zone still points selector1._domainkey at the old tenant. The message can still reach the recipient, but verification fails because the receiver cannot find the active key behind that selector. Publish the current target, not a different From address.
How do you fix the failure?
Start with the exact header wording, then work from the signer to DNS to mail flow. If the receiver says the signature is missing, enable DKIM for the domain. If it says the body hash failed, stop message rewriting. If it names a selector problem, repair the CNAME chain and retest with a fresh outbound message.
- Inspect the raw headers. Copy the full
Authentication-ResultsandDKIM-Signaturelines. Readdkim=fail,dkim=neutral, ordkim=none, then noted=ands=for the next checks. - Verify domain-level signing. In Microsoft 365, confirm the domain is enabled on the DKIM tab. Exchange Online does not enable DKIM per mailbox or per app; the setting appears to apply to the domain.
- Confirm the two CNAMEs. Check both selector records before enabling signing. Microsoft 365 requires the two selector CNAME records to exist first, and the hostnames must match the current sender domain.
- Check for message changes. Review disclaimers, transport rules, and other mail-flow changes that modify the body after signing. That usually shows up as a body hash error in the receiver text.
- Send a fresh test. Use a new outbound message after each fix. Then compare the new headers, not the old failed one, because the old one still reflects the broken state.
What causes post-change DKIM breakage?
Post-change failures usually appear after tenant moves, domain changes, selector rotation, or mail-flow edits. The common pattern is simple: the signing domain, DNS selector, or body content changed, but the other two did not. That leaves the receiver with a signature that no longer matches the published key or the final message body.
Selector mismatch after a domain or tenant change
A selector mismatch happens when the header references one selector but DNS publishes another. This is common after a domain migration or when a tenant keeps old DNS live too long and then removes the wrong record. Check the exact s= value, then verify that selector host in DNS before changing anything else.
Missing CNAME target or stale DNS after rotation
Microsoft 365 relies on two selector CNAMEs. If one target is missing, points to the wrong tenant, or was deleted early, verification can fail even though mail still leaves the tenant. Old selectors should stay live during rotation until every sender has switched and the receiver can still resolve the old key.
Body rewriting by transport rules or disclaimers
body hash did not verify means the body changed after signing. That can happen when a disclaimer is appended, a transport rule rewrites content, or a connector injects text after Exchange Online signs the message. There is no DKIM setting in Microsoft 365 that reorders those changes after the signature step.
Suppose a transport rule adds a two-line footer after the message is signed. The sender and selector can both be correct, yet the receiver still rejects the hash because the body it received is no longer the body that was signed.
Expired or revoked keys and removed old selectors
The x= field can show when a signature expires. An empty p= in a published key can indicate revocation. If an old selector is removed too early, still-in-flight mail and cached DNS lookups can fail even though the new selector is already live. Keep the old record published until the transition is complete.
Common mistakes
- Checking the visible From address instead of the
d=field that the receiver actually verified. - Publishing a TXT record at the selector host when Microsoft 365 expects the selector CNAMEs to resolve correctly.
- Turning on DKIM before both selector records exist and resolve cleanly.
- Assuming
dkim=passmeans DMARC must pass, even when alignment is off. - Leaving old selectors in DNS for too little time during a rotation.
- Forgetting that a gateway, relay, or disclaimer rule may be modifying mail outside Exchange Online.
A common first-time mistake is to fix DNS, send the same cached test message again, and trust the old header. That can hide the real result. Always send a fresh message after the change, then inspect the new raw headers.
If that didn't work, try this next
- Check connectors first. Review inbound and outbound connectors, secure gateways, and third-party relays in the mail path. If another system signs or rewrites mail, fix that system before changing Microsoft 365 DKIM again.
- Verify the active selector pair. Make sure both
selector1._domainkeyandselector2._domainkeyexist and point to the correct tenant targets. If one was changed during a migration, republish the missing target. - Test from a clean path. Send a message that avoids the modifying transport rule or disclaimer, then compare the new
Authentication-Resultsline. If that message passes, the rule is the break point.
Keep both old and new selector records published during rotation. Do not remove the old one until fresh outbound mail is passing from the new selector.
Frequently asked questions
Why is DKIM verification failing in Exchange Online?
Most often because the receiver found a signature, but the selector, key, or body no longer matches. Check Authentication-Results for the exact wording, then confirm the domain is enabled in the Microsoft 365 DKIM area and that both selector CNAMEs resolve before sending another test message.
How do I enable DKIM in Exchange Online?
Go to the Microsoft 365 Defender portal, then Email & collaboration, then Email authentication settings, then DKIM. Publish the two required selector CNAMEs first, then turn on signing for the domain on the DKIM tab. If the menus differ in your tenant, search for DKIM settings.
What does dkim=fail mean in email headers?
It means the receiver found a DKIM signature but could not verify it. Read the adjacent receiver text for the reason, then compare the selector, signing domain, and body hash. That is usually enough to tell whether the fault is DNS, signing, or message rewriting.
What causes body hash did not verify in DKIM?
The body changed after signing. A disclaimer, transport rule, footer, or relay can alter the message and break the bh= match. Send a clean test that skips the modifying rule, then check whether the same message passes before changing DNS again.
What is the difference between DKIM fail and DMARC fail?
DKIM fail means the signature could not be verified. DMARC fail means the message did not meet DMARC policy, which can happen even when DKIM passes if d= is not aligned with the From domain. Check both headers before changing the sender domain or policy.
How long should I keep old DKIM selectors published?
Keep old selectors live through the full rotation window and until fresh outbound mail shows the new selector is in use. If you remove the old record too early, queued or cached lookups can fail. After the switch is stable, remove the retired selector and retest one more time.