// GUIDE

SPF, DKIM and DMARC in Microsoft 365

Microsoft 365 only signs the onmicrosoft.com domain on its own. For your custom domain to pass DMARC you publish its SPF, create the DKIM keys in the Defender portal, publish the two CNAMEs it gives you and turn signing on. Then DMARC.

What to publish

SPF TXT @ (the domain)

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

If Microsoft 365 is your only sender. If you also send from other services, add their include: before -all: one SPF record per domain and at most 10 DNS lookups. In GCC High or DoD, include:spf.protection.office365.us; with 21Vianet, include:spf.protection.partner.outlook.cn.

DKIM CNAME selector1._domainkey

The one the Defender portal shows you, for example selector1-yourdomain-com._domainkey.yourcompany.n-v1.dkim.mail.microsoft (for domains set up long ago, it ends in onmicrosoft.com).

Do not type it by hand: every organisation has its own.

DKIM CNAME selector2._domainkey

The second one the portal shows you (the same, with selector2).

Microsoft uses both to rotate keys.

DMARC TXT _dmarc

v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

Start at p=none with reports and move to quarantine and reject once all your legitimate mail passes (below).

Step by step

  1. At your DNS provider, publish the SPF record (or add include:spf.protection.outlook.com to the one you have).
  2. In the Microsoft Defender portal (security.microsoft.com), go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM tab (shortcut: security.microsoft.com/authentication?viewid=DKIM).
  3. Open your domain and press “Create DKIM keys”. The portal shows you the two CNAMEs: publish them as they are in your DNS.
  4. Once the CNAMEs resolve (it can take a while), go back to the domain and turn on “Sign messages for this domain with DKIM signatures”.
  5. Publish DMARC at p=none with an rua mailbox and read the reports for a few weeks before raising the policy.

Usual mistakes

Towards p=reject

DMARC at p=none only watches. The reports (rua) show who sends on your behalf; once all your legitimate mail passes aligned SPF or DKIM, move to quarantine and then to reject. That way, nobody can use your domain to send forged mail.

Check your domain

Sources

Checked on 24 September 2026. Panels change: if something does not match, the provider’s documentation wins.