Opens in a new tab

Microsoft 365 SPF, DKIM and DMARC setup

Microsoft 365 (Exchange Online) sends with your own domain as the bounce address, so it needs Microsoft in your SPF record and DKIM switched on for your domain. DKIM here is two CNAME records, selector1 and selector2, that point at keys Microsoft hosts and rotates for you.

SPFinclude:spf.protection.outlook.com
DKIMCNAMEs selector1 and selector2
Bounce domainYour own domain — SPF aligns
Set up inDefender portal → Email & collaboration → Policies → Email authentication settings → DKIM

Is your domain set up for Microsoft 365?

We read your SPF record, look for Microsoft 365’s DKIM key and check DMARC. Nothing is stored.

SPF for Microsoft 365

Microsoft’s record is include:spf.protection.outlook.com, and Microsoft recommends ending it with -all. Government clouds differ: GCC High and DoD use include:spf.protection.office365.us, and Microsoft 365 operated by 21Vianet uses include:spf.protection.partner.outlook.cn.

Your initial *.onmicrosoft.com domain needs nothing: Microsoft maintains its SPF record.

If you have no SPF record yet, publish this TXT record on @ (the domain itself):

v=spf1 include:spf.protection.outlook.com ~all

If you already have one, add include:spf.protection.outlook.com to it, before the ~all or -all at the end. A domain must have exactly one SPF record: a second one makes both fail.

include:spf.protection.outlook.com uses 1 of the 10 DNS lookups an SPF record is allowed (measured 27 September 2026). Past 10, receivers fail SPF for all of your mail. What is inside include:spf.protection.outlook.com, and whether you need it →

DKIM for Microsoft 365

In the Microsoft Defender portal, go to Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM, select your domain and create the DKIM keys. Publish the two CNAME records it shows, then switch signing to Enabled.

Domains added since May 2025 point at a target ending in dkim.mail.microsoft; older ones point at your tenant’s onmicrosoft.com domain. Copy the exact values from the portal, or from PowerShell: Get-DkimSigningConfig -Identity <domain> | fl Selector1CNAME,Selector2CNAME.

New keys are 1024-bit by default. Rotate to 2048 with Rotate-DkimSigningConfig -KeySize 2048; Microsoft says a rotation takes about four days to start signing with the new key.

NameTypeValue
selector1._domainkeyCNAMEselector1-<domain-with-dashes>._domainkey.<tenant>.<x>-v1.dkim.mail.microsoft
selector2._domainkeyCNAMEselector2-<domain-with-dashes>._domainkey.<tenant>.<x>-v1.dkim.mail.microsoft

The exact values come from Microsoft 365; copy them from there. Placeholders are in angle brackets.

Bounce domain and DMARC

With DKIM enabled for your domain, Microsoft 365 mail passes DMARC on both SPF and DKIM. Without it, custom-domain mail is not signed with your domain, so DMARC depends on SPF alone and fails when a message is forwarded.

If you do not send from the onmicrosoft.com domain, Microsoft suggests publishing p=reject for it, in the Microsoft 365 admin centre (Settings → Domains → DNS records), not at your registrar.

No DMARC record yet? Start with one that only reports, read the reports for a couple of weeks, then tighten it: build it with the DMARC generator.

Common mistakes

  • Signing cannot be enabled until both CNAMEs are found — the status reads CnameMissing. The dashes, dots and underscores in the targets are easy to mistype.
  • Mixing the two target formats: the old onmicrosoft.com form and the new dkim.mail.microsoft form cannot both be used for the same selector.
  • Leaving the 1024-bit default in place; rotate to 2048.

Questions

Why two selectors?

Microsoft signs with one while the other waits, and swaps them when the key rotates. Both CNAMEs must stay published, or the next rotation breaks DKIM.

Does Microsoft 365 send DMARC failure (ruf) reports?

No. Microsoft sends aggregate (rua) reports only.

Sources

Checked against Microsoft 365’s own documentation on 25 September 2026:

See every service’s mail pass or fail

Point your DMARC reports at us and we name every server sending as your domain, with what passes, what fails and the exact fix. Free for your first domain.

Create a free account