How to Configure the Correct SPF Record for Microsoft 365
Question details
The user needs to determine the correct SPF record format for Microsoft 365 to properly authorize mailboxes and external website senders without exceeding DNS lookup limits.

- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Configuring domain DNS settings to authorize Microsoft 365 and third-party website servers for successful email delivery.
- Observed behavior
- Using incorrect domains or exceeding the 10-DNS-lookup limit causes SPF validation failures, leading to rejected emails or spam flagging.
Before editing your DNS settings, compile a complete list of all services, website forms, and third-party applications that are authorized to send emails on behalf of your domain.
Configure a Unified Microsoft 365 SPF Record
Create a single SPF record that authorizes Microsoft 365 and any third-party website senders while enforcing strict failure policies.
A proper SPF record ensures that receiving servers trust the emails sent from your domain. For Microsoft 365, the base domain is spf.protection.outlook.com. You must combine this with any external sending services into a single TXT record.
Start your SPF record declaration with the standard Microsoft 365 protection domain: v=spf1 include:spf.protection.outlook.com
Add any authorized website senders using the include mechanism. For example, add include:website-sender.example before the failure mechanism.
Append -all at the end of the record to enforce a hard fail for unauthorized senders. The final string should look like: v=spf1 include:spf.protection.outlook.com include:website-sender.example -all
Log into your domain registrar or DNS hosting provider, navigate to the DNS management portal, locate your domain's SPF (TXT) record, and save the newly constructed string.

Remove Deprecated Microsoft Domains from Existing SPF Records
Clean up your current SPF record by replacing older or unnecessary Microsoft domains with the correct unified protection domain to free up DNS lookups.
Looking for a Lightweight Alternative to Microsoft 365?
While configuring complex DNS and email settings is necessary for Microsoft 365, managing your office documents shouldn't be complicated. WPS Office provides a free, highly compatible, and lightweight alternative for your daily document editing needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Open Office Files: Launch WPS Office and directly open your existing Microsoft Word, Excel, or PowerPoint documents without format loss.
- 3. Save and Collaborate: Edit your documents and securely save them in standard Office formats to maintain compatibility with external partners.

Frequently Asked Questions
What happens if my SPF record exceeds 10 DNS lookups?
If your SPF record exceeds the 10-DNS-lookup limit, receiving mail servers will fail to evaluate the record completely. This results in SPF validation errors, causing your legitimate emails to be marked as spam or rejected outright by the recipient's server.
Should I use -all or ~all at the end of my Microsoft 365 SPF record?
Microsoft recommends using -all (Hard Fail) to strictly authorize only the listed senders and protect your domain against spoofing. However, this should only be done after you have thoroughly verified that every legitimate sending service is included. Use ~all (Soft Fail) only temporarily during testing phases.
Can I have multiple SPF TXT records for a single domain?
No, a domain must only have one SPF TXT record. If you have multiple email services, you must combine them into a single record by adding multiple 'include' statements, such as 'v=spf1 include:spf.protection.outlook.com include:third-party.com -all'.
How can I verify that my SPF record is formatted correctly?
You can use an external SPF validation tool, such as the MxToolBox SPF Record Generator, to check your syntax, verify authorized domains, and ensure you have not exceeded the DNS lookup limit before applying the changes.




