Skip to main content
WebTools

How to set up DMARC for Microsoft 365, step by step

Set up SPF, DKIM and DMARC for a Microsoft 365 domain in the right order, then move safely from monitoring to quarantine and reject.

Published

Illustration of an envelope passing through three gates of increasing strength towards a building protected by a shield.
On this page

The short answer: with Microsoft 365, set up SPF first, then turn on DKIM, then publish a DMARC record at _dmarc.yourdomain starting with p=none. Read the reports for a few weeks, fix any service that fails, then move to p=quarantine and finally p=reject. Microsoft cannot publish the DMARC record for your own domain for you: you add it as a TXT record wherever your DNS is hosted.

This guide walks through each step in order, with the records you need and the checks to run before you tighten the policy. It assumes your mail is hosted in Exchange Online and that you can edit your domain's DNS records.

Diagram of the three DMARC stages: p=none to monitor, p=quarantine to send failing mail to spam, and p=reject to refuse it, with a few weeks of reports between each stage.
Move through the three policies one at a time, reading reports between each step.

Why the order matters: SPF, DKIM, then DMARC

DMARC does not check anything by itself. It looks at the results of SPF and DKIM and asks one extra question: does the domain that passed match the domain in the visible From address? That match is called alignment. A message passes DMARC when SPF or DKIM passes and is aligned with the From domain.

That is why Microsoft's own deployment guidance puts the three in a fixed order: SPF, then DKIM, then DMARC. If you publish a strict DMARC policy before SPF and DKIM are working, receivers will treat your genuine mail as a forgery.

Diagram showing an email's From domain compared with the SPF domain and the DKIM signing domain. DMARC passes when at least one of them passes and matches the From domain.
DMARC passes when SPF or DKIM passes and matches the From domain.

Step 1: check your SPF record

SPF lists the servers allowed to send mail for your domain. For a domain that only sends through Microsoft 365, Microsoft's documented record is:

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

A few rules from Microsoft's SPF guidance catch people out:

  • A domain can have only one SPF record. If you use other senders (a newsletter tool, a CRM, a website contact form), add their include: to the same record instead of creating a second one.
  • Each subdomain that sends mail needs its own SPF record. A record on your main domain does not cover news.yourdomain.
  • SPF has a limit of 10 DNS lookups. Every extra include: uses at least one, and many services use several.

Try it now

SPF Checker

Check a domain's SPF record: syntax, the 10 DNS-lookup limit across every include, void lookups, and what the "all" setting means.

Open the tool: SPF Checker

Step 2: turn on DKIM in Microsoft Defender

DKIM adds a digital signature to every message. Microsoft 365 signs outgoing mail with your domain's key once you publish two CNAME records and switch signing on. The steps, from Microsoft's DKIM documentation, are:

  1. Open the Microsoft Defender portal and go to Email & collaboration → Policies & rules → Threat policies → Email authentication settings, then the DKIM tab.
  2. Select your custom domain. The panel shows two CNAME records, named selector1._domainkey and selector2._domainkey.
  3. Copy each value exactly as shown. Newer tenants get values ending in dkim.mail.microsoft; older ones end in onmicrosoft.com. Don't type them from memory or copy them from another tenant.
  4. Add both CNAME records at your DNS host, then wait for them to appear (often minutes, sometimes longer).
  5. Back in the DKIM panel, switch Sign messages for this domain with DKIM signatures on.

Once DKIM is on, mail sent through Microsoft 365 is signed with a key for your own domain. That signature aligns with your From address, which is what DMARC needs. It also survives most forwarding, where SPF usually breaks.

Step 3: publish a DMARC record in monitoring mode

The DMARC record is a TXT record at _dmarc on your domain. Start with a policy of none, which asks receivers to deliver mail as normal but send you reports:

Name:  _dmarc
Type:  TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com

Microsoft notes that for your own domain this record is created at your domain registrar or DNS host. The Microsoft 365 admin centre can add a DMARC record only for the built-in onmicrosoft.com domain.

The parts of the record are:

  • v=DMARC1: always first.
  • p=: the policy, none, quarantine or reject.
  • rua=: where aggregate reports go. Use a mailbox you actually read, or a DMARC reporting service. If the address is at a different domain, that domain must publish a record agreeing to receive your reports.
DMARC Checker result for example.com: Pass, DMARC policy found: p=reject. It shows the record v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s and a table explaining each tag.
The DMARC Checker shows the record, the policy that applies and what each tag means. Example.com sends no email, so it uses the strictest policy.

Try it now

DMARC Checker

Check a domain's DMARC record: the policy that applies, whether it is inherited, alignment, reporting addresses and mistakes, following RFC 9989.

Open the tool: DMARC Checker

Step 4: read the reports and fix what fails

Aggregate reports arrive daily from large mailbox providers as compressed XML files. They list every server that sent mail using your domain and whether SPF and DKIM passed and aligned. Raw XML is hard to read, so most people use a reporting service or a free parser.

Spend at least two to four weeks at p=none, long enough to see monthly mailings such as invoices. For each sender in the reports, decide:

  1. It's us, and it passes. Nothing to do.
  2. It's us, and it fails. Usually a third-party service sending as your domain. Add it to SPF, or better, set up DKIM signing for your domain in that service.
  3. It isn't us. That is spoofing, which is exactly what the stricter policies stop.

Step 5: move to quarantine, then reject

When every genuine sender passes, change p=none to p=quarantine. Receivers then send failing mail to spam. Keep watching the reports for another few weeks, then change to p=reject, which asks receivers to refuse failing mail outright.

Microsoft recommends this gradual approach and suggests doing subdomains first and the main domain last. If you have subdomains that never send mail, you can cover them with sp=reject, or the newer np=reject for names that don't exist.

Does Outlook.com require DMARC?

For bulk senders, yes. Since 5 May 2025, Outlook.com, Hotmail and Live.com have required domains sending more than 5,000 messages a day to pass SPF and DKIM and to publish a DMARC policy of at least p=none, aligned with SPF or DKIM. Mail that doesn't meet this is rejected with error 550 5.7.515. Gmail and Yahoo have similar rules for bulk senders.

Even if you send far less than that, a DMARC record helps: it stops others using your domain in phishing, and receivers trust aligned, authenticated mail more.

Common problems

ProblemLikely causeFix
Two DMARC results, or noneTwo TXT records at _dmarc, or a typo in the nameKeep exactly one record named _dmarc.
DMARC fails for a newsletter toolIt signs with its own domain, not yoursSet up custom DKIM for your domain in that tool.
No reports arriveReport address at another domain without permission, or a typo in ruaCheck the address; publish the authorisation record if needed.
Forwarded mail fails SPFForwarding changes the sending serverExpected. DKIM usually survives forwarding, so make sure DKIM is on.

Common questions

Do I need a DMARC record if my domain doesn't send email?

Yes, and it's the easiest case. A domain that never sends mail can go straight to v=DMARC1; p=reject, along with an SPF record of v=spf1 -all. That tells receivers to refuse anything claiming to come from it, which stops the domain being used in phishing.

How long does a DMARC change take to work?

Receivers see the new record as soon as their cached copy of the old one expires. That depends on the record's TTL, usually between a few minutes and a few hours. Reports reflect the change from the next daily report onwards.

Will DMARC stop all spam?

No. DMARC stops other people using your exact domain in the From address. It doesn't stop look-alike domains, such as a spelling with one letter changed, and it doesn't filter the spam you receive. Your mailbox provider's filters do that.

Should the report address be a normal mailbox?

It can be, but large domains receive many reports a day, and they're compressed files rather than readable messages. A dedicated mailbox, or a reporting service that turns the files into charts, is easier to live with. Don't use a personal mailbox that someone reads every day.

Checklist before you switch to reject

  • SPF: one record, under 10 lookups, includes every genuine sender.
  • DKIM: switched on in Microsoft Defender, both CNAMEs in place.
  • DMARC: one record at _dmarc, reports arriving and read.
  • Every third-party sender passes and aligns in the reports.
  • Subdomains that send mail have their own SPF and are covered by your plan.

Use the DMARC Checker and SPF Checker on this site after each change to confirm what receivers will see. They read the public DNS records only; they don't send any email.

  • DMARC Checker

    Check a domain's DMARC record: the policy that applies, whether it is inherited, alignment, reporting addresses and mistakes, following RFC 9989.

  • SPF Checker

    Check a domain's SPF record: syntax, the 10 DNS-lookup limit across every include, void lookups, and what the "all" setting means.

  • DNS Lookup

    Look up the DNS records for a domain: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA, or the reverse DNS (PTR) name of an IP address.