logo
search
Security Policy Errors

How to Configure the Correct SPF Record for Microsoft 365

Khadija KhanKhadija Khan Oct 8, 2026 868 views

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.

How to Configure the Correct SPF Record for Microsoft 365
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 you start

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.

Solution 1Recommended

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.

1
Identify the base Microsoft 365 domain

Start your SPF record declaration with the standard Microsoft 365 protection domain: v=spf1 include:spf.protection.outlook.com

2
Append third-party senders

Add any authorized website senders using the include mechanism. For example, add include:website-sender.example before the failure mechanism.

3
Apply the strict 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

4
Update your DNS TXT records

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.

Configure a Unified Microsoft 365 SPF Record
Verification Tip: Always verify that your combined SPF record stays within the maximum limit of 10 DNS lookups using an external validation tool like the MxToolBox SPF Record Generator.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Open Office Files: Launch WPS Office and directly open your existing Microsoft Word, Excel, or PowerPoint documents without format loss.
  3. 3. Save and Collaborate: Edit your documents and securely save them in standard Office formats to maintain compatibility with external partners.
Fully compatible with Microsoft Office file formats including .docx, .xlsx, and .pptx.Lightweight architecture for faster installation and smoother document processing.Familiar user interface requiring zero learning curve for a seamless migration.Free access to essential word processing, spreadsheet, and presentation tools.
microsoft office alternative - wps office

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.