Official DNS Guide • Enterprise Email & Collaboration

Microsoft 365 / Office 365 (Exchange Online) SPF Record Setup & Validator

Configure Microsoft 365 SPF record (include:spf.protection.outlook.com), dual CNAME DKIM selectors, and DMARC enforcement.

Quick Answer • Exact Microsoft 365 SPF Syntax

To authorize Microsoft 365 / Office 365 (Exchange Online) to send emails on behalf of your domain, add include:spf.protection.outlook.com to your domain's single DNS TXT SPF record before the terminating ~all mechanism. The standard record is v=spf1 include:spf.protection.outlook.com -all.

Live Microsoft 365 DNS Validator

Test your domain's published SPF, DKIM, and DMARC records via global DoH edge nodes in real time.

Zero-Log Client Evaluation

Understanding Microsoft 365 / Office 365 (Exchange Online) Email Authentication

Microsoft 365 Exchange Online enforces dual-selector CNAME-based DKIM rotation (selector1 and selector2) and requires SPF authorization via "include:spf.protection.outlook.com".

When Microsoft 365 / Office 365 (Exchange Online) delivers outbound emails on your behalf, recipient mail transfer agents (MTAs) at Google, Yahoo, Microsoft, and corporate mail gateways inspect the sender identity. Without a published SPF record explicitly permitting Microsoft 365 / Office 365 (Exchange Online)'s IP ranges, these emails trigger SPF Softfail (~all) or Hardfail (-all), severely degrading domain reputation and inbox placement.

Required DNS Records for Microsoft 365

Publish the following DNS records in your domain registrar or DNS management console (Cloudflare, AWS Route 53, GoDaddy, Namecheap):

TypeHost / NameValue / TargetTTLPurpose
TXT@v=spf1 include:spf.protection.outlook.com -all3600Authorizes Exchange Online sending servers.
CNAMEselector1._domainkeyselector1-domain-com._domainkey.domain.onmicrosoft.com3600Primary DKIM endpoint.
CNAMEselector2._domainkeyselector2-domain-com._domainkey.domain.onmicrosoft.com3600Secondary DKIM endpoint.

Step-by-Step Setup Instructions

1

Open DNS Zone Editor for your domain.

2

Add "include:spf.protection.outlook.com" to your existing root SPF TXT record.

3

Go to Microsoft Defender portal > Threat Policies > DKIM.

4

Add both CNAME records (selector1 and selector2) pointing to your ".onmicrosoft.com" endpoint.

5

Enable DKIM signing in Microsoft Defender.

Common Microsoft 365 SPF Configuration Mistakes

× DKIM Toggle Fails in Admin

Cause: Attempting to toggle before CNAMEs propagate.

Fix: Wait 15 minutes and retry.

Frequently Asked Questions

Why does Microsoft 365 use two DKIM selectors?

To support automatic cryptographic key rotation without manual DNS updates.