How to Set Up DMARC, SPF and DKIM for Microsoft 365 (Step by Step, 2026)

Last updated: November 2026

Disclosure: WavesRank is reader-supported. Some links on this site may be affiliate links, which means we may earn a commission at no extra cost to you. The steps below follow Microsoft’s own documentation on Microsoft Learn, checked in November 2026. See our Affiliate Disclosure and Editorial Policy.

Steps checked November 2026

If your business sends email through Microsoft 365 using your own domain, you need three DNS records to prove that email is really from you: SPF, DKIM and DMARC. Microsoft 365 does not set up DKIM for your own domain automatically, so many small businesses have only part of the job done.

This guide walks through all three in Microsoft 365, with the exact records and the current admin portal steps.

Quick answer

  • SPF: TXT record at @: v=spf1 include:spf.protection.outlook.com -all (add other senders to the same record).
  • DKIM: Microsoft Defender portal > Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM. Create the keys, add the two CNAME records Microsoft shows you, then turn signing on.
  • DMARC: TXT record at _dmarc: start with v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com, then move to quarantine and reject.
  • Also: add v=DMARC1; p=reject to your onmicrosoft.com domain in the Microsoft 365 admin center.

Why Microsoft 365 users need to do this

  • DKIM is off for your own domain until you turn it on. Microsoft signs mail for your onmicrosoft.com domain automatically, but according to Microsoft, no DKIM signing happens for custom domains until you complete the setup.
  • Big mailbox providers now require it. Gmail requires SPF or DKIM for all senders, and SPF, DKIM and DMARC for bulk senders. Outlook.com has introduced similar rules for high-volume senders.
  • It stops spoofing. Without DMARC, anyone can send email that appears to come from your domain. See how to stop email spoofing.

Before you start

  1. Admin access to the Microsoft 365 admin center and the Microsoft Defender portal (security.microsoft.com).
  2. DNS access for your domain (for example GoDaddy, Cloudflare or your web host).
  3. A list of everything that sends email as your domain: Microsoft 365, your website forms, newsletter tool, invoicing software, CRM, scanners. Each one must pass SPF or DKIM before you enforce DMARC.

Step 1: Check or set up SPF

When you added your domain to Microsoft 365, the setup wizard probably asked you to add an SPF record. Check it exists and is correct:

Type Host / Name Value
TXT @ v=spf1 include:spf.protection.outlook.com -all
  • Other senders: add their include: to the same record, for example v=spf1 include:spf.protection.outlook.com include:sendgrid.net -all.
  • Only one SPF record per domain. Two records break SPF.
  • -all or ~all? -all (hard fail) is the usual choice once you are sure every sender is listed. If you are still finding senders, start with ~all and tighten it later.

Step 2: Turn on DKIM for your domain

  1. Open the Microsoft Defender portal and go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings, then the DKIM tab. (You can also go straight to security.microsoft.com/authentication.)
  2. Find your domain. Its status should show NoDKIMKeys. Turn on the toggle, or open the domain and select Create DKIM keys.
  3. An error message appears showing the CNAME values. This is expected. Select OK.
  4. The status changes to CnameMissing. Click the domain’s row (not the toggle) to open its details and copy the two values under Publish CNAMEs.
  5. At your DNS host, create two CNAME records:
    Type Host / Name Points to
    CNAME selector1._domainkey The selector1 value Microsoft shows you
    CNAME selector2._domainkey The selector2 value Microsoft shows you

    Copy the values exactly from the portal. Newer domains use values ending in dkim.mail.microsoft; older ones end in onmicrosoft.com. Do not copy an example from another website.

  6. Wait for DNS to update (minutes to a few hours), then return to the domain’s details and turn on Sign messages for this domain with DKIM signatures. The status should change to Signing DKIM signatures for this domain.

Key size: the portal creates 1024-bit keys. Microsoft documents how to create or rotate to 2048-bit keys with Exchange Online PowerShell (New-DkimSigningConfig with -KeySize 2048, or Rotate-DkimSigningConfig for an existing domain). An IT provider can do this in a few minutes.

Step 3: Add your DMARC record

First, create a dedicated mailbox or Microsoft 365 group for DMARC reports. Microsoft advises against using an individual user’s mailbox because reports can arrive in large numbers. A DMARC reporting tool can also receive them for you; see our DMARC tools comparison.

Then add this record at your DNS host:

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

p=none only monitors; nothing is blocked. Reports start arriving within a day or two, showing every service sending as your domain.

Step 4: Move to quarantine, then reject

Microsoft recommends a gradual rollout rather than jumping straight to reject. When the reports show every legitimate sender passing:

  1. Quarantine: v=DMARC1; p=quarantine; pct=10; rua=mailto:dmarc-reports@yourdomain.com, then raise pct through 25, 50, 75 and 100 while watching the reports.
  2. Reject: v=DMARC1; p=reject; pct=100; rua=mailto:dmarc-reports@yourdomain.com, which is Microsoft’s end goal for custom domains.

Not sure what each policy does? See DMARC policy: none, quarantine or reject.

Step 5: Protect your onmicrosoft.com domain

Every Microsoft 365 tenant has a domain like yourcompany.onmicrosoft.com. Microsoft recommends a DMARC record on it too, so nobody can spoof it:

  1. In the Microsoft 365 admin center, go to Settings > Domains and select your onmicrosoft.com domain.
  2. Open DNS records and select Add record.
  3. Type: TXT; TXT name: _dmarc; TXT value: v=DMARC1; p=reject. Save.

Do the same at your registrar for any parked domains you own but never send email from.

How to check it is working

  1. Send an email from Outlook to a Gmail or Outlook.com address you control.
  2. Open the message headers (in Gmail: three dots > Show original).
  3. Look for SPF: PASS, DKIM: PASS with your own domain, and DMARC: PASS.

Common problems

Problem Likely cause Fix
DKIM status stuck on CnameMissing CNAME typo, or the DNS host added the domain twice Enter only selector1._domainkey as the host; copy the value exactly
DKIM passes but shows onmicrosoft.com, not your domain Signing not turned on for the custom domain Turn on “Sign messages for this domain with DKIM signatures”
Website or newsletter emails fail DMARC That service is not in SPF and does not sign with your domain Add its SPF include and turn on its DKIM for your domain
Gmail rejects mail with 550 5.7.26 Email failed authentication Check SPF, DKIM and DMARC for the sending service
Scanner emails start failing Scanner uses an outside server or basic sign-in See scan to email in Microsoft 365

Frequently asked questions

Does Microsoft 365 set up DKIM automatically? Only for your onmicrosoft.com domain. For your own domain, you must create the keys and add two CNAME records.

Why two DKIM records? Microsoft uses two selectors so it can rotate keys without breaking email: one is active while the other is ready for the next key.

How long does this take? About 30 minutes of work, plus DNS update time and a week or more of monitoring before you enforce DMARC.

Do I need a paid DMARC tool? Not to publish the records. A tool helps you read the reports and find senders that fail, especially if you use several email services. Compare options in EasyDMARC vs PowerDMARC vs dmarcian.

We use Google Workspace instead. See our Google Workspace guide.

About the author

Shafiq Ahmed has worked in IT and cybersecurity for more than ten years, helping businesses secure email, Microsoft 365, networks and firewalls. WavesRank guides follow vendor documentation and are updated when steps change. Read our editorial policy.

Steps were checked against Microsoft Learn in November 2026. Microsoft renames portal menus from time to time; if a step looks different, open security.microsoft.com/authentication.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top