DMARC setup for Microsoft 365: step-by-step guide
You’ll publish three records for your domain (SPF, DKIM and DMARC) and then tighten the DMARC policy in stages. The records usually take about an hour. The watching-and-tightening part usually takes a few weeks, because you want the reports to show you every real sender before you block anything.
This guide is for Microsoft 365 (Exchange Online) and a custom domain like yourcompany.com. For what each record does, read SPF, DKIM and DMARC: what’s the difference? first. Here we stick to the steps.
- Step 1: Publish your SPF record
- Step 2: Turn on DKIM signing
- Step 3: Publish DMARC at p=none
- Step 4: Read your reports
- Step 5: Move to quarantine, then reject
Why do this now
Gmail and Yahoo (since February 2024) and Outlook.com (since May 2025) set sender rules. They apply to anyone who sends more than 5,000 messages a day to their users. Gmail and Yahoo require SPF, DKIM and a DMARC record that’s at least p=none. Outlook.com requires SPF and DKIM to pass, and DMARC at least p=none and aligned with SPF or DKIM. Outlook.com sends mail that doesn’t comply to the Junk folder, and has said it will later reject it.
Most small businesses send far less than 5,000 a day. The records still matter. They’re what stops someone sending email as you.
Before you start
You need three things.
- Admin access to Microsoft 365, enough to open the Microsoft Defender portal and change email authentication settings.
- Access to your DNS host, the company where your domain’s DNS is managed (often the same place you bought the domain). Microsoft 365 has no screen for editing SPF or DMARC records in a custom domain. You publish them at your DNS host.
- A list of every service that sends email as you. Your mailboxes, plus your CRM, invoicing tool, newsletter service, helpdesk, website forms, and any scanner or printer that emails. If you skip a sender now, it fails once you enforce.
If a service you don’t control sends bulk email for you (a newsletter tool, for example), Microsoft recommends giving it a subdomain such as marketing.yourcompany.com. That keeps a problem there from hurting the reputation of your main domain.
Step 1: Publish your SPF record
At your DNS host, add one TXT record on your main domain (host @, or blank, depending on your DNS host). If you only send from Microsoft 365, the value is:
v=spf1 include:spf.protection.outlook.com -all
If other services send as you, add an include: for each one, inside the same record. Microsoft’s example with an on-premises server and a mailing service looks like this:
v=spf1 ip4:192.168.0.10 include:servers.adatum.com include:spf.protection.outlook.com -all
(Use your own sender’s include value from its documentation. Those two are Microsoft’s placeholders.)
Rules to follow:
- One SPF record per domain. If you already have one, edit it. Don’t add a second.
- Fewer than 10 DNS lookups. Each
include:counts, and includes inside includes count too. Individualip4:andip6:addresses don’t. - Each subdomain that sends mail needs its own SPF record.
- Set the TTL to 3600 seconds (one hour) or more, as Microsoft recommends.
About the ending: Microsoft recommends -all (reject anything not listed) for Microsoft 365 domains, because you’ll also have DKIM and DMARC. ~all is the softer version.
Don’t have a record yet? The Microsoft 365 setup may already have created one. Look before you add.
Step 2: Turn on DKIM signing
Until you do this, Microsoft 365 doesn’t sign mail from your custom domain with your domain. This is the step people miss.
- Go to the Microsoft Defender portal at security.microsoft.com. Choose Email & collaboration, then Policies & rules, then Threat policies, then Email authentication settings. (Direct link: security.microsoft.com/authentication.)
- Select the DKIM tab.
- Find your domain. If its status is NoDKIMKeys and the toggle is off, slide the toggle to Enabled.
- A Client error dialog opens. That’s expected: it means the DNS records don’t exist yet. Select OK. The domain’s status is now CnameMissing.
- Select the domain’s row to open its details. Under Publish CNAMEs, you’ll see two records. Copy them.
- At your DNS host, create both as CNAME records. They look like this (yours will have different values, so copy them from the portal):
selector1._domainkey CNAME selector1-yourcompany-com._domainkey.yourcompany.n-v1.dkim.mail.microsoft
selector2._domainkey CNAME selector2-yourcompany-com._domainkey.yourcompany.n-v1.dkim.mail.microsoft
- Wait a few minutes (it can take longer), then go back to the domain’s details and turn on Sign messages for this domain with DKIM signatures.
- When it works, the status reads Signing DKIM signatures for this domain. It can take several minutes to update.
If the toggle won’t turn on, the portal can’t see your CNAME records yet. Check them for typos (dashes, periods and underscores are easy to get wrong), wait a while longer, and try again.
Repeat for every domain and subdomain that sends mail.
Step 3: Publish DMARC at p=none
Choose where reports go before you publish. Create a dedicated mailbox or a Microsoft 365 group for them, such as dmarc-reports@yourcompany.com. Microsoft advises against using a person’s mailbox.
At your DNS host, add a TXT record:
Host: _dmarc
Type: TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourcompany.com
p=none means “watch, don’t block”. Mail is delivered as normal, and you start receiving reports. If pct= isn’t in the record, it defaults to 100.
Keep the record to rua= for now. Microsoft suggests starting with aggregate reports and adding ruf= later only if you need it.
A few other cases:
- Subdomains inherit the DMARC record of your main domain, even ones that don’t exist. A record on a subdomain overrides it.
- Domains you own but never send from: publish an SPF record of
v=spf1 -alland a DMARC record ofv=DMARC1; p=reject;. This covers youronmicrosoft.comdomain too if you don’t send from it. You add that DMARC record in the Microsoft 365 admin center: Settings, then Domains, then the onmicrosoft.com domain, then DNS records, then Add record. - Reports going to another domain: the other domain has to publish an authorisation TXT record, or receivers won’t send the reports. Keep reports on your own domain to avoid this.
Step 4: Read your reports
Receiving mail systems send a summary about once a day, called an aggregate report. They arrive as email attachments: an XML file, usually compressed. Not every receiver sends them.
Raw XML is hard to read. Use a DMARC report reader. Microsoft points to the vendors in its Intelligent Security Association catalog (search for “DMARC” at microsoft.com/misapartnercatalog). Reading them yourself, you’re looking for four things:
- Source IP and count. Who sent mail as your domain, and how much.
- Whether SPF and DKIM passed. And, separately, whether they aligned (matched your From address).
- Known sender, passing but not aligned. A real service you forgot to set up properly. Fix it.
- Unknown sender, high volume, all fails. Likely someone spoofing you. No action needed. This is what your policy will block.
The pattern to watch for is a sender whose SPF or DKIM passes but whose domain doesn’t match your From address. The service is authorised but not set up to sign as you. Fix it in that service’s settings. Usually that means turning on “sign with my own domain”, or changing its return-path (MAIL FROM) domain to yours.
Forwarded mail and mailing lists often fail. That’s normal, and not a reason to hold back.
Step 5: Move to quarantine, then reject
When the reports show every real sender passing and aligned, tighten the policy. Change the value of the same _dmarc record.
- Quarantine. Change
p=nonetop=quarantine. Failing mail goes to the junk folder instead of being lost. Microsoft suggests easing in with thepct=tag, in steps:pct=10,25,50,75, then100. - Reject. Once quarantine is clean, change to
p=reject.
v=DMARC1; p=reject; rua=mailto:dmarc-reports@yourcompany.com
Keep reading the reports after each change. Microsoft says to go slowly and expects a few false positives along the way. Moving a low-volume subdomain first and your main domain last is the safest order.
Once you’re at p=quarantine or p=reject, outbound mail from your domain that fails DMARC at the receiving end goes through Microsoft’s high-risk delivery pool. That’s one more reason to fix failing senders before you tighten.
Common mistakes with Microsoft 365
- Publishing the CNAMEs but never turning on the toggle. The records sit in DNS and nothing signs your mail.
- Typos in the CNAME values. Copy and paste from the portal. Don’t retype.
- A second SPF record. A CRM or newsletter tool tells you to “add this SPF record”, and you do. Merge its
include:into the one you have. - Mistyped includes.
include:spf.protection.outlook.com.with a trailing period,include=instead ofinclude:, or a space after the colon all break SPF. - Too many lookups. Past 10, SPF returns an error. Remove services you no longer use. Don’t flatten the Microsoft 365 include into IP addresses, because Microsoft’s addresses change often.
- A third-party sender that signs with its own domain. It passes DKIM but not DMARC. Set it up to sign with yours.
- Skipping a subdomain. Each subdomain that sends needs its own SPF and DKIM.
- Going to reject too fast. Invoices disappear. Follow the order above.
Check your work
Our free domain check reads your SPF and DMARC records from outside and tells you what’s missing. It can’t see DKIM, because those keys sit under a selector name only your provider knows. To check DKIM, send a message to an outside address and look in its headers for dkim=pass, spf=pass and dmarc=pass.
Two next steps
Want it done for you? We set up SPF, DKIM and DMARC for your domain, find every sender, and move you to enforcement without losing real mail. Email us and tell us which senders you use.
Records can’t stop every fake. A lookalike domain, or a convincing message that reaches an inbox some other way, gets past them. Your staff are the other half. Shiftskill’s Phishing and Cyber Basics for Staff course takes about 25 minutes and uses Canadian examples.
Stay secure,
Luke Stephenson
Would you rather have this done once, and done right? Tell us which email system you use and who sends as you, and we'll set it up and take you to enforcement without losing real mail.