Guides / SPF record for Microsoft 365 (Office 365): the exact value and common mistakes
SPF record for Microsoft 365 (Office 365): the exact value and common mistakes
If your mailboxes are on Microsoft 365 (Office 365, Exchange Online), your domain needs an SPF record that authorizes Microsoft's mail servers. Microsoft's own example for a domain that only sends from Microsoft 365 is v=spf1 include:spf.protection.outlook.com -all. Most sales and cold email domains also send through other tools, and that is where SPF breaks: a second record, a missing include, or a typo. Run the free checker above to see your current record, then use the steps below.
The record to publish
Add one TXT record at the root of the domain (the host is usually shown as @ or left blank) with this value:
v=spf1 include:spf.protection.outlook.com -all
That is the example in Microsoft's documentation, Set up SPF to identify valid email sources for your Microsoft 365 domain, for a domain where Microsoft 365 is the only source of email. The same page says "Most Microsoft 365 organizations require include:spf.protection.outlook.com in the SPF TXT record for the domain."
- Microsoft 365 Government Community Cloud High (GCC High) and Department of Defense tenants use include:spf.protection.office365.us instead, per the same page. Ordinary business tenants use spf.protection.outlook.com.
- If you only send from the yourcompany.onmicrosoft.com address, you don't need to do anything. Microsoft says the SPF record for that domain "is already configured for you" and can't be changed.
- Use a TXT record. The old SPF record type is not what receivers look up.
~all or -all?
Microsoft recommends -all (hard fail) for Microsoft 365 domains "because we also recommend DKIM and DMARC for the domain". Its documentation also notes that DMARC treats -all and ~all both as SPF failures.
The catch for sales and cold email domains is the word "all": -all tells receivers to reject mail from any server you didn't list. If you're not yet sure every tool that sends as your domain is in the record, start with ~all, confirm in real message headers that each tool passes SPF, then switch to -all. The free checker suggests the ~all version when a Microsoft 365 domain has no SPF record at all, as the safe first step. For the full comparison, see SPF ~all vs -all.
Adding other senders without a second record
A domain can have only one SPF record. Microsoft's page puts it plainly: "only one SPF record is allowed per domain or subdomain", and multiple SPF records "cause SPF to return permerror". If you also send through a marketing platform, a CRM, a help desk or an email API, add its include to the same record:
v=spf1 include:spf.protection.outlook.com include:example-sender.com -all
Use the exact include each provider gives in its setup page, and keep the all rule at the end. See multiple SPF records if you already have two.
Cold email tools connected to Microsoft 365 inboxes
Sending tools that connect to your Microsoft 365 mailbox (by Microsoft sign-in or through Microsoft's SMTP server) hand the message to Microsoft, which sends it from its own servers, so the Microsoft include already covers them. You only need another include for a service that sends from its own servers, such as an email API or a marketing platform. If you're not sure which kind a tool is, send a test message through it and read the SPF result in the headers (steps below).
Staying under the 10-lookup limit
SPF allows at most 10 DNS lookups while a record is evaluated. Each include, a, mx, exists and redirect counts, and so do the includes nested inside them. Microsoft's page warns that "having fewer than 10 include: statements doesn't guarantee fewer than 10 DNS lookups" for exactly that reason.
When we checked on December 4, 2026, spf.protection.outlook.com listed Microsoft's IP ranges directly (ip4 and ip6 ranges, ending in -all), so it cost one lookup. Other providers' includes can cost several each. See SPF too many DNS lookups if your record is over the limit.
Common mistakes
- The mailboxes are on Microsoft 365 (your MX record ends in mail.protection.outlook.com), but the SPF record only lists another service, often the web host. Mail sent from Microsoft 365 then fails SPF, and Outlook.com may bounce it with 550 5.7.23.
- Two SPF records, often one left by the web host or domain registrar and one added for Microsoft 365. Merge them into one.
- Syntax typos. Microsoft lists these as common mistakes: a trailing period (include:spf.protection.outlook.com. -all), an equals sign instead of a colon (include=spf.protection.outlook.com), and a space after the colon (include: spf.protection.outlook.com).
- A dead include for a tool you stopped using. Microsoft notes that if an include domain doesn't resolve or has no SPF record, SPF returns permerror. See the SPF void lookup limit.
- A subdomain you send from has no record of its own. Microsoft's page says "each subdomain requires its own SPF TXT record"; the root domain's record doesn't cover it. See SPF for a subdomain.
- Switching to -all before every real sender is listed, so mail from a forgotten tool fails.
How to check it worked
- Wait for DNS to update. It's often minutes, but can take up to the record's TTL or longer.
- Run the free checker above and confirm there is one SPF record, it includes spf.protection.outlook.com, and it needs 10 lookups or fewer.
- Send a test message from your Microsoft 365 mailbox to a Gmail address and open Show original. SPF should say PASS with your domain. Repeat through each sending tool.
- Recheck after you add a new sending tool or change your DNS host.
Keep an eye on it
SPF records get changed when someone adds a tool, moves DNS hosts or cleans up old records. OutboxWatch checks SPF, DKIM, DMARC, MX and blocklists on your sending domains every day and emails you when something changes, so a dropped include gets caught before replies drop. To finish the Microsoft 365 setup, also turn on DKIM: see DKIM setup for a custom domain in Microsoft 365.
Frequently asked questions
What is the SPF record for Microsoft 365 (Office 365)?
v=spf1 include:spf.protection.outlook.com -all, published as a single TXT record at the root of the domain. That's Microsoft's example for a domain that only sends from Microsoft 365. Add other senders' includes to the same record.
Should I use ~all or -all with Microsoft 365?
Microsoft recommends -all, alongside DKIM and DMARC. Use ~all while you're still confirming that every tool that sends as your domain is listed, then switch to -all.
Do I need an SPF record for my onmicrosoft.com domain?
No. Microsoft says the SPF record for the onmicrosoft.com domain is already configured for you, and you can't change it. You only add SPF records for your own custom domains.
Can I have one SPF record for Microsoft 365 and another for my other tools?
No. Only one SPF record is allowed per domain or subdomain; two records make SPF return permerror. Merge them into one record with all the includes.
How many DNS lookups does include:spf.protection.outlook.com use?
When we checked on December 4, 2026, it used one: the record lists Microsoft's IP ranges directly with no nested includes. The whole SPF record must stay at 10 lookups or fewer.
Related guides
- SPF record for Google Workspace: the exact value and common mistakes
- How to set up DKIM in Microsoft 365 for your own domain
- Hotmail and Outlook.com bouncing with 550 5.7.23: what to check
- Multiple SPF records: why two records break SPF and how to merge them
- SPF record: too many DNS lookups, and how to fix it
- SPF ~all vs -all: which one should a cold email domain use?
- Does a subdomain need its own SPF record?
- Cold email deliverability checklist
- All guides
- Monitoring plans