Skip to content
  • There are no suggestions because the search field is empty.

DMARC for Microsoft 365

Microsoft 365 handles SPF and DKIM for you only on your built-in *.onmicrosoft.com domain. For your own domain, such as example.com, you publish SPF, two DKIM CNAME records, and a DMARC TXT record at your DNS host, and you switch DKIM signing on in the Microsoft Defender portal. Until you do, Microsoft's own documentation says, "no DKIM signing occurs for outbound mail from custom domains." There's no Microsoft 365 screen that publishes DMARC for a custom domain.

The order matters: SPF, then DKIM, then DMARC at p=none, then enforcement once your reports look clean.

What Microsoft does for you, and what it doesn't

Domain SPF DKIM DMARC
yourtenant.onmicrosoft.com Already configured Signed automatically You add it in the Microsoft 365 admin center
Your custom domain You publish it at your DNS host You publish 2 CNAMEs, then enable signing You publish it at your DNS host

There are no admin portals or PowerShell cmdlets in Microsoft 365 for you to manage DMARC TXT records in your custom domains. You create the record at your domain registrar or DNS host.

The onmicrosoft.com DMARC record

Add a DMARC record for your *.onmicrosoft.com domain even if you don't send from it. In the Microsoft 365 admin center, go to Settings > Domains, select the onmicrosoft.com domain, open DNS records, choose Add record, and create a TXT record with the name _dmarc. A typical value is v=DMARC1; p=reject.

Step 1: SPF record for Microsoft 365

Publish one SPF TXT record at your domain. Most Microsoft 365 (formerly Office 365) organizations need include:spf.protection.outlook.com, plus includes for any other services that send as you:

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

Microsoft's examples end in -all. That's Microsoft's recommendation. For sending domains, our default is ~all, because a hard fail can get mail rejected before DMARC is evaluated at all. The trade-off is explained in Softfail vs fail (~all vs -all).

If you add another sender later, merge its include into this record. A second v=spf1 record breaks SPF (Multiple SPF records (why that is invalid)). How to write the full record is in How to write an SPF record.

Step 2: Enable DKIM in Microsoft 365

This is the step people miss, and it's the one DMARC depends on most.

  1. Get your two CNAME values. In the Defender portal, go to Email authentication settings, open the DKIM tab, and select your domain. The host names are always selector1._domainkey and selector2._domainkey. The targets are specific to your tenant. Current ones end in dkim.mail.microsoft, and older tenants may show a target under onmicrosoft.com. Copy the exact values from the portal (or Get-DkimSigningConfig), never from an example.
  2. Publish both as CNAME records at your DNS host. Not TXT, and not just one of them.
  3. Turn signing on. Back on the DKIM tab, switch the toggle to Enabled. If the status shows CnameMissing, Microsoft can't see your DNS records yet. Wait for DNS and try again.

A few details that cause trouble:

  • TTL. Microsoft recommends at least 3600 seconds on the DKIM CNAMEs. Very low TTLs are linked to intermittent dkim=temperror.
  • Cloudflare. Set the DKIM CNAMEs to DNS only, not proxied.
  • Subdomains. Each subdomain you send from needs its own DKIM configuration.
  • Key size. The PowerShell default is 1024-bit, and 2048 is available. Key size is covered in 1024-bit vs 2048-bit DKIM keys.
  • Rotation. In Microsoft 365, a key rotation takes four days (96 hours) before the new key starts signing (How to rotate a DKIM key).

Selectors and DKIM DNS records in general are in DKIM selectors and DNS records.

Once DKIM is enabled, mail from your domain carries d=example.com, which aligns with your From address. That's the aligned pass DMARC needs (Identifier alignment for SPF and DKIM).

Step 3: Publish DMARC

Set up SPF and DKIM for every custom domain and subdomain you send from before you configure DMARC. Then publish a TXT record at _dmarc at your DNS host, starting in monitoring mode:

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"

p=none doesn't change how receivers handle your mail. The rua address is what gets you aggregate reports, and Microsoft recommends a dedicated mailbox or Microsoft 365 Group, not a user's inbox (rua, ruf, and report authorization). The general setup walk-through is on our DMARC setup page.

Step 4: Move toward enforcement carefully

Microsoft recommends going gradually: p=none while you monitor, then p=quarantine, then p=reject. It suggests starting with a low-volume subdomain and working through the rest in order of volume and complexity, "saving the parent domain for last." Subdomain records are covered in Subdomain policy (sp), and the staged rollout in A safe rollout: p=none to quarantine to reject.

Two things in Microsoft's guide to read with care:

  • It still uses pct and steps it from 10 to 100. The current DMARC standard removed pct. Don't add it. If an old record has it, remove it.
  • It says the goal is to get to a p=reject DMARC policy for all your domains. That's Microsoft's position for its platform. Domains used for general-purpose email should not deploy a DMARC policy of p=reject, because of how it interacts with mailing lists. Whether reject is right for a given domain depends on how its users send mail (When you are ready for p=reject). If you do go to reject, the domain must have aligned DKIM, not SPF alone.

There's also a Microsoft-specific reason to fix alignment before enforcing. If your policy is p=quarantine or p=reject, outbound Microsoft 365 mail that fails DMARC at the destination is routed through Microsoft's high-risk delivery pool. "There's no override for this behavior."

Domains you don't send from

For registered domains in your tenant that never send mail, to publish a DMARC record saying no mail should come from them, such as v=DMARC1; p=reject;. Pair it with an SPF record of v=spf1 -all, and don't publish any DKIM records for them. With no public key in DNS, a forged signature can't validate.

Other services sending as your domain

Microsoft 365's DKIM only covers mail Microsoft 365 sends. A marketing platform, CRM, or invoicing tool sending as @example.com needs its own aligned DKIM, or a custom MAIL FROM on your domain. Microsoft's alignment table lists a service that "sends on your behalf" with its own MAIL FROM and no custom DKIM as a typical DMARC failure. It also suggests putting bulk services "that aren't under your direct control" on a subdomain, such as marketing.example.com. See How to add a third-party sender without breaking DMARC and Email sending platforms: SPF, DKIM and DMARC setup.

On the receiving side

A short note, since it explains some report gaps. As a receiver, Microsoft 365 sends DMARC aggregate reports only when the receiving domain's MX points directly to Microsoft 365, and it doesn't send failure (ruf) reports at all. How it treats incoming mail that fails another domain's DMARC depends on the tenant's anti-phishing settings. When Honor DMARC record policy is turned on (Microsoft's recommended setting), Microsoft documents the result as: mail that fails under p=quarantine goes to the Junk Email folder (configurable to quarantine), and mail that fails under p=reject is rejected during SMTP. Setup problems on the receiving side are in Microsoft 365 or Google Workspace setup issues.

The separate rules for high-volume senders to consumer Outlook.com addresses are in Google, Yahoo, and Microsoft sender requirements and Microsoft and Outlook authentication rules.

Mistakes worth avoiding

  • Publishing p=quarantine or p=reject before custom-domain DKIM is enabled, so mail depends on SPF alone and fails when it's forwarded.
  • Creating the DKIM records as TXT instead of CNAME, or publishing only selector1.
  • Copying CNAME targets from an article instead of from your tenant.
  • Forgetting the *.onmicrosoft.com DMARC record.
  • Adding a second SPF record for a new service instead of merging includes.
  • Copying pct steps from Microsoft's rollout guide.

Free DMARC account

Turn raw DMARC reports into a readable dashboard

Point your rua address to our platform and read the results by sender and source instead of opening XML files.

  • Results grouped by sending source
  • SPF, DKIM and alignment results per sender
  • The original XML reports are still there to download

Create a free DMARC accountTalk to an expert

FAQ

Does Microsoft 365 publish DMARC for me?

Only for *.onmicrosoft.com, which you add in the admin center. For your own domain, add the TXT record at your DNS host.

Is DKIM on by default?

Only for *.onmicrosoft.com. For each custom domain, publish the two CNAMEs and turn signing on in the Defender portal.

Should I use -all or ~all?

Microsoft recommends -all. Our default for sending domains is ~all, because of the caution about hard fail. See Softfail vs fail (~all vs -all).

Will Microsoft 365 send me DMARC reports?

As a receiver, Microsoft 365 sends aggregate reports when the recipient domain's MX points directly to Microsoft 365. It doesn't send failure (ruf) reports.

What is the "DMARC aggregate report from Microsoft Corporation" email?

An aggregate report Microsoft sent to your rua address about mail it received from your domain. What's in it is covered in A field-by-field walk-through of a DMARC aggregate report.

How long does DKIM key rotation take in Microsoft 365?

Four days (96 hours) before the new key starts signing.