Introduction
To set up DMARC for Microsoft 365, publish SPF with include:spf.protection.outlook.com, add the two DKIM CNAME records (selector1, selector2) and enable DKIM signing in the Microsoft Defender portal, then publish a _dmarc TXT record at p=none with a report address. Add p=reject for the onmicrosoft.com domain, authorise other senders, read reports, then move to quarantine and reject.
This guide turns that into numbered steps with exact records, the current portal paths from Microsoft Learn, verification checks and the Microsoft 365 pitfalls that break rollouts. It is written for MSPs running many client tenants, but every step works for a single tenant admin. For protocol background, start with the DMARC guide.
Key takeaways
- Microsoft 365 does not DKIM-sign mail from custom domains until you publish the two CNAMEs and turn signing on, so DMARC cannot rely on DKIM before that.
- The
*.onmicrosoft.com(MOERA) domain needs its own DMARC record, added in the Microsoft 365 admin center, not at your DNS host. - Roll out in full steps:
p=none, thenp=quarantine, thenp=reject. RFC 9989 removedpct, even though Microsoft's own examples still show it. - Gateways in front of Microsoft 365 change how inbound DMARC is evaluated and stop Microsoft sending aggregate reports for that domain.
What do you need before you start?
You need admin access to the client tenant (Microsoft 365 admin center and Defender portal), write access to the DNS zone of each custom domain, and an aggregate report destination. Microsoft's own order is SPF first, then DKIM, then DMARC: its DMARC article states you must create SPF records and configure DKIM signing "for all custom domains and subdomains you use to send email" before configuring DMARC.
Also collect, per tenant:
- every accepted domain and subdomain that sends mail;
- the MX record (direct to Microsoft 365, or to a gateway first);
- known third-party senders (CRM, marketing, ticketing, billing, scanners, line-of-business apps);
- any on-premises Exchange or SMTP relay still in the path.
For scanners, printers and line-of-business apps, record whether each one uses SMTP AUTH, Direct Send or a relay connector, because Direct Send devices are the ones that break at p=reject.
How do I set up DMARC for Microsoft 365, step by step?
Follow these eight steps per custom domain. Steps 1 to 4 are configuration you finish in an afternoon; steps 5 to 8 are a monitored rollout over several weeks. The records use contoso.com as the client domain and msp.example as the MSP's reporting domain.
Step 1: Publish the SPF record
Publish one TXT record at the domain apex. Microsoft's Set up SPF article gives this value when Microsoft 365 is the only source of mail:
contoso.com. TXT "v=spf1 include:spf.protection.outlook.com -all"
Microsoft recommends -all (hard fail) for Microsoft 365 domains "because we also recommend DKIM and DMARC for the domain." If the domain has an on-premises server or another sender, add it to the same record, for example v=spf1 ip4:192.0.2.10 include:spf.protection.outlook.com -all. Keep within the 10 DNS lookup limit of RFC 7208: above 10, SPF returns permerror. Sovereign clouds use different includes: spf.protection.office365.us for GCC High and DoD, and spf.protection.partner.outlook.cn for 21Vianet. Every mechanism, the sovereign-cloud includes and worked hybrid examples are in the Microsoft 365 SPF record explained.
Each sending subdomain needs its own SPF record; the apex record does not cover marketing.contoso.com. Check the result with the SPF analyzer.
Step 2: Publish the DKIM CNAME records
Microsoft 365 needs two CNAME records per custom domain, one per selector. Microsoft's Set up DKIM article documents the current format for new custom domains (introduced in May 2025):
selector1._domainkey.contoso.com. CNAME selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft.
selector2._domainkey.contoso.com. CNAME selector2-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft.
The contoso before .n-v1 is the tenant's initial domain prefix, and the n is a partition character Microsoft assigns, so never type these by hand. Older domains still use the earlier format, such as selector1-contoso-com._domainkey.contoso.onmicrosoft.com. Microsoft notes the two formats cannot coexist for the same selector. Copy the exact values from the portal (Step 3) or from Exchange Online PowerShell:
Get-DkimSigningConfig | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME
If the domain is not listed, create the configuration first with New-DkimSigningConfig -DomainName contoso.com -Enabled $false.
Step 3: Enable DKIM signing in the Microsoft Defender portal
The path Microsoft documents is: Defender portal at https://security.microsoft.com > Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM tab (direct link: https://security.microsoft.com/authentication?viewid=DKIM).
- Select the custom domain. If no keys exist, the flyout offers Create DKIM keys.
- Note the CNAME values shown under Publish CNAMEs and publish them (Step 2). Until Microsoft sees them, the status reads CnameMissing.
- Wait for Microsoft 365 to detect the records; Microsoft says this "takes a few minutes (or possibly longer)."
- Turn on Sign messages for this domain with DKIM signatures. The status changes to Signing DKIM signatures for this domain.
The PowerShell equivalent is Set-DkimSigningConfig -Identity contoso.com -Enabled $true. Microsoft automatically signs mail from the initial *.onmicrosoft.com domain, but states that "no DKIM signing occurs for outbound mail from custom domains" until you complete these steps. That default signature is not aligned with contoso.com, so it cannot pass DMARC for the custom domain. To move to 2048-bit keys, run Rotate-DkimSigningConfig -Identity contoso.com -KeySize 2048; Microsoft notes the new key applies at the next rotation and takes four days (96 hours) to start signing.
Step 4: Publish the DMARC record at _dmarc
Publish a TXT record at _dmarc with a monitoring policy and an aggregate report address:
_dmarc.contoso.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc@msp.example"
Leave out pct. Microsoft's Set up DMARC article still shows the percentage tag and a 10, 25, 50, 75, 100 percent ramp, but RFC 9989, which obsoletes RFC 7489, removed the tag (Appendix A.6), so receivers following the current standard ignore it. A ruf address adds little here: Microsoft 365 itself "doesn't send DMARC Forensic reports."
Because the rua destination is on a different domain, msp.example must authorise it under RFC 9990, Section 4, for example with *._report._dmarc.msp.example TXT "v=DMARC1". Build and check the record with the DMARC generator and the DMARC checker.
Step 5: Add DMARC for the onmicrosoft.com (MOERA) domain
Microsoft hosts DNS for contoso.onmicrosoft.com, so you add its DMARC record in the Microsoft 365 admin center. Microsoft's path: https://admin.microsoft.com > Show all > Settings > Domains > select the *.onmicrosoft.com domain (click the row, not the check box) > DNS records tab > Add record. In the Add a custom DNS record flyout set:
| Field | Value |
|---|---|
| Type | TXT (Text) |
| TXT name | _dmarc |
| TXT value | v=DMARC1; p=reject |
| TTL | 1 hour |
Select Save. If nobody sends from the onmicrosoft.com address, p=reject is safe straight away; add a rua address if you want reports. If some users or apps still send from it, monitor first. Its SPF record is already managed by Microsoft and cannot be edited.
Step 6: Authorise third-party senders
Every service that sends as contoso.com must pass aligned SPF or aligned DKIM, or its mail fails DMARC. For each sender, set up custom DKIM signing with the client's domain (usually CNAME or TXT records at a vendor-specific selector) and, where the vendor uses your domain as the bounce address, add its SPF include. Microsoft recommends a subdomain such as marketing.contoso.com for bulk services you do not control. The full process is in how to handle third-party senders during DMARC projects.
Step 7: Monitor aggregate reports at p=none
Leave p=none in place until reports show every legitimate source passing with alignment. Microsoft gives no fixed duration ("after enough time monitoring"); two to four weeks covers most monthly senders such as billing runs. Look for unknown sources, Microsoft 365 traffic failing DKIM (signing not enabled), and senders passing SPF on their own bounce domain without alignment. DMARC aggregate reports explained covers how to read them.
Step 8: Move to p=quarantine, then p=reject
Change the policy in full steps, each gated on clean reports, with a rollback plan to the previous level:
_dmarc.contoso.com. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@msp.example"
_dmarc.contoso.com. TXT "v=DMARC1; p=reject; np=reject; rua=mailto:dmarc@msp.example"
np=reject (new in RFC 9989, Section 4.7) applies only to non-existent subdomains; without it, they fall back to sp, then p. If you want a softer signal during a transition, RFC 9989 defines t=y: receivers then apply one level lower (p=reject; t=y is treated as quarantine). Microsoft recommends working from low-volume subdomains up and saving the parent domain for last. The gating criteria are in how to move from monitoring to enforcement safely.
How do I verify the setup works?
Send a test message from a mailbox on the custom domain to an external mailbox you control and read the Authentication-Results header. You want SPF, DKIM and DMARC all passing, with the DKIM d= domain (or header.i) matching the From domain:
Authentication-Results: mx.google.com;
dkim=pass header.i=@contoso.com header.s=selector1;
spf=pass smtp.mailfrom=contoso.com;
dmarc=pass (p=NONE) header.from=contoso.com
Paste the header into the email header analyzer, confirm the CNAMEs with the DKIM validator, and run Get-DkimSigningConfig: Microsoft expects Enabled: True and Status: Valid. Microsoft omits the DKIM signature when sender and recipient are in the same organisation, so always test to an external address.
How does Microsoft 365 handle inbound mail that fails DMARC?
Microsoft 365 honours the sender's DMARC policy through the anti-phishing policy setting Honor DMARC record policy when the message is detected as spoof, which is on by default. Microsoft's recommended-settings table lists the defaults as Quarantine the message for p=quarantine and Reject the message for p=reject.
You find the setting at Email & collaboration > Policies & rules > Threat policies > Anti-phishing (https://security.microsoft.com/antiphishing). The p=quarantine action can be quarantine or Junk Email folder; the p=reject action can be reject or quarantine. A rejected message carries 550 5.7.1 in the SMTP response and an oreject action in the header:
Authentication-Results: spf=fail ... dmarc=fail action=oreject header.from=contoso.com; compauth=fail reason=100
Check the configuration per tenant with Get-AntiPhishPolicy | Format-List Name, HonorDmarcPolicy, DmarcQuarantineAction, DmarcRejectAction. If a legitimate sender fails, Microsoft prefers configuring it as a trusted ARC sealer over a mail flow rule or a Tenant Allow/Block List entry (which expires after 30 days). DMARC and Microsoft Defender goes deeper.
What are the common Microsoft 365 DMARC pitfalls?
Typical pitfalls are DKIM never enabled for the custom domain, no DMARC record on the onmicrosoft.com domain, a gateway in front of Microsoft 365 without Enhanced Filtering for Connectors, SPF over 10 lookups and leftover percentage tags. Each is easy to check per tenant:
- DKIM never enabled for the custom domain. Mail carries only the onmicrosoft.com signature, which does not align, so DMARC depends entirely on SPF and breaks on forwarding.
- Custom domain and onmicrosoft.com confused. Records for
contoso.comgo to the client's DNS host (see adding a DMARC record in Azure DNS if that is Azure); the onmicrosoft.com record goes in the admin center. Users or apps still sending from onmicrosoft.com addresses show up in its reports. - A gateway in front of Microsoft 365. When the MX points to a filtering service, Microsoft sees the gateway's IP. Microsoft states the Honor DMARC setting "is applied only if Enhanced Filtering for Connectors is enabled" on the inbound connector, and Microsoft 365 sends aggregate reports only when the MX points directly to it. See why DMARC fails with a gateway in front of Microsoft 365.
- Enhanced Filtering for Connectors left off. Configure it at Threat policies > Rules > Enhanced filtering (
https://security.microsoft.com/skiplisting), usually with Automatically detect and skip the last IP address. The Enhanced Filtering for Connectors guide has the detail. - SPF over 10 lookups. Every extra sender adds includes; check after each new SaaS signup.
- Outbound mail failing at enforcement. Microsoft routes outbound mail that fails DMARC at the destination through its high-risk delivery pool when the domain is at
p=quarantineorp=reject, with no override. Fix the sender before tightening. pctcopied from old templates. Remove it; it implies a partial rollout that current receivers do not perform.
What do Outlook.com's sender requirements add?
Microsoft's consumer services (Outlook.com, Hotmail, Live.com) apply authentication requirements to domains that send 5,000 or more messages to them. Those senders need passing SPF and DKIM, a DMARC record of at least p=none, and DMARC alignment through SPF or DKIM. Non-compliant mail can be rejected with 550 5.7.515 Access denied, sending domain <domain> does not meet the required authentication level., per Microsoft Support; our guide to fixing 550 5.7.515 rejections walks through the fix per platform. A Microsoft 365 tenant that completes the steps above already meets them. See Microsoft Outlook sender requirements.
What does DMARCbis (RFC 9989) change for Microsoft 365 tenants?
Very little in the setup, but the record should change. RFC 9989 removed pct, rf and ri, added np, psd and t, and the rollout is now full steps from none to quarantine to reject. Microsoft 365 still needs the same SPF, DKIM and alignment work. DMARCbis for Microsoft 365 clients has the tenant checklist.
Per-tenant MSP checklist
Use the same checklist for every client tenant so onboarding, change control and client conversations follow one pattern:
| # | Task | Where | Done when |
|---|---|---|---|
| 1 | Inventory sending domains, MX path and third-party senders | Admin center, DNS, client interview | List signed off by client |
| 2 | SPF with include:spf.protection.outlook.com -all |
Client DNS | Under 10 lookups, no permerror |
| 3 | Publish selector1 and selector2 CNAMEs |
Client DNS | Values match Get-DkimSigningConfig |
| 4 | Enable DKIM signing per custom domain | Defender portal > Email authentication settings > DKIM | Status: Signing DKIM signatures for this domain |
| 5 | _dmarc TXT at p=none with rua |
Client DNS | Reports arriving |
| 6 | Authorise external rua destination |
MSP DNS (_report._dmarc) |
Reports from major receivers |
| 7 | MOERA _dmarc TXT v=DMARC1; p=reject |
Admin center > Settings > Domains | Record visible in DNS records tab |
| 8 | Custom DKIM and SPF for each third-party sender | Vendor portals, client DNS | Aligned pass in reports |
| 9 | Check gateway, Enhanced Filtering, anti-phishing DMARC actions | Defender portal | HonorDmarcPolicy True, connector configured |
| 10 | p=quarantine, then p=reject with np=reject |
Client DNS, change ticket | Client approval recorded per step |
Record every policy change under your DMARC change-management policy. Running the reports across a portfolio is what a multi-tenant platform such as DMARC AI for MSPs is built for.
Frequently asked questions
Does Microsoft 365 sign mail with DKIM by default?
Only for the initial *.onmicrosoft.com domain. Microsoft states that no DKIM signing occurs for outbound mail from custom domains until you publish the two CNAME records and turn on signing in the Defender portal. The onmicrosoft.com signature does not align with your custom domain, so it does not help DMARC pass.
Where do I add the DMARC record for my onmicrosoft.com domain?
In the Microsoft 365 admin center, under Settings > Domains, select the onmicrosoft.com domain, open the DNS records tab and add a TXT record named _dmarc with the value v=DMARC1; p=reject. You cannot add it at your own DNS host, because Microsoft hosts that zone.
Should I use pct to roll out DMARC on Microsoft 365?
No. RFC 9989 removed the pct tag, so receivers following the current standard ignore it, even though Microsoft's documentation still shows it. Move in full steps from p=none to p=quarantine to p=reject, each gated on clean aggregate reports, and use t=y if you need a temporary softer signal.
Does Microsoft 365 honour other domains' DMARC p=reject?
Yes, by default. The anti-phishing setting Honor DMARC record policy is on, with reject for p=reject and quarantine for p=quarantine. If the MX points to a third-party gateway, Microsoft only applies it when Enhanced Filtering for Connectors is enabled on the inbound connector.
How long does DMARC setup for Microsoft 365 take?
The SPF, DKIM and DMARC records take an afternoon per domain, plus the time Microsoft needs to detect the CNAMEs. The rollout to p=reject takes several weeks of monitoring, depending on how many third-party senders the client has and how quickly vendors can configure aligned DKIM.