How to Set Up SPF, DKIM & DMARC for Microsoft 365

The exact DNS records and portal steps - SPF, DKIM and DMARC done right for Microsoft 365.

By Henry Timmes · Email Deliverability Consultant · Named contributor to RFC 7489 & RFC 9989 (DMARC)
Microsoft 365SPFDKIMDMARCSetup
Henry Timmes
Henry Timmes Email Deliverability Consultant · Named contributor to RFC 7489 & RFC 9989 (DMARC)

The exact DNS records and portal steps - SPF, DKIM and DMARC done right for Microsoft 365.

What Microsoft 365 Needs

To authenticate mail sent from or through Microsoft 365, you publish three DNS records: an SPF record authorizing Microsoft's servers, DKIM signing enabled in the Microsoft 365 Defender portal, and a DMARC record telling receivers how to handle failures. If you also send through other services (an ESP, a CRM), each one must be included too.

SPF for Microsoft 365

Microsoft 365's SPF include is include:spf.protection.outlook.com. A typical record for a domain that sends only through Microsoft 365 looks like this:

HostTypeValue
@TXTv=spf1 include:spf.protection.outlook.com -all

If you send through other services as well, add each provider's include before the -all. Keep to one SPF record, and stay under the 10 DNS-lookup limit.

DKIM for Microsoft 365

Enable DKIM in the Microsoft Defender portal under Email & collaboration → Policies & rules → Threat policies → DKIM. Microsoft gives you two CNAME records (selector1 and selector2) to publish in DNS; once they resolve, you switch DKIM signing on for the domain.

HostTypePoints to
selector1._domainkeyCNAMEselector1-<domain>._domainkey.<tenant>.onmicrosoft.com
selector2._domainkeyCNAMEselector2-<domain>._domainkey.<tenant>.onmicrosoft.com

DMARC for Microsoft 365

Publish a DMARC record at _dmarc.<domain>. Start at p=none with a reporting address so you can observe before enforcing:

HostTypeValue
_dmarcTXTv=DMARC1; p=none; rua=mailto:dmarc@<domain>

Once every legitimate source aligns, move to p=quarantine and then p=reject. The full path is in the migration guide.

Frequently Asked Questions

What is the SPF record for Microsoft 365?

For a domain that sends only through Microsoft 365: v=spf1 include:spf.protection.outlook.com -all. Add other providers' includes before -all if you send through them too, and keep to a single SPF record under 10 DNS lookups.

How do I enable DKIM in Microsoft 365?

In the Microsoft Defender portal under Email & collaboration → Policies & rules → Threat policies → DKIM, publish the two selector CNAME records Microsoft provides, then enable signing for the domain.

What DMARC policy should I start with for Microsoft 365?

Start at p=none with a rua reporting address so you can see all your sending sources, fix any that don't align, then progress to p=quarantine and p=reject.

Emails landing in spam?

Henry Timmes diagnoses why your mail isn't reaching the inbox - Microsoft 365, Gmail, Yahoo and beyond - and maps a practical fix. Book a free 15-minute call, no obligation.

Book a free consultation