In short. SPF is the list of servers allowed to send emails on behalf of your domain. If it is missing or badly written, your emails risk being sent to spam or rejected by your recipients' mail systems. It is up to you, or to your IT provider who manages your domain, to add one line at your domain host, in its directory (the DNS). Allow a few minutes of configuration, and make sure you have only one list per domain: with two, the check fails for all your emails.
If Microsoft 365 is the only service that sends email for your domain, Microsoft recommends this SPF record: v=spf1 include:spf.protection.outlook.com -all. You create it at your DNS host, as a TXT record on the domain itself, not inside Microsoft 365. If an SPF record already exists, add include:spf.protection.outlook.com to it instead of creating a second one.
SPF tells receiving mail servers which servers may send email for your domain. Without it, more of your messages land in spam, and DMARC can't protect your domain.
Last verified: November 18, 2026, against Microsoft's official documentation.
Before you start: list everything that sends as you
One SPF record must cover everything that sends email as your domain. Write the list down before you touch DNS:
- Microsoft 365 (Outlook, Exchange Online);
- your website, if it sends email (contact forms, orders);
- your tools: newsletter, CRM, invoicing, customer support;
- any on-premises mail server, with its public IP address.
Each tool's documentation gives the include: or IP address to add. Microsoft advises sending the mail of services you don't control directly, such as bulk email, from a subdomain (for example news.your-domain.com). That way their problems don't hurt the reputation of your main domain.
Step 1: check whether an SPF record already exists
Microsoft 365 doesn't manage the SPF record of your domains: there is no admin page or PowerShell cmdlet for it. The record lives at your DNS host (often your domain registrar). First check what is published:
nslookup -type=TXT your-domain.comLook for a line that starts with v=spf1. When you added the domain, the Microsoft 365 setup may already have had you create one. If so, go to step 3.
Step 2: create the SPF record
At your DNS host, add a record:
- Type:
TXT - Name / host:
@(or leave it blank, depending on the host: it means the domain itself) Value:
v=spf1 include:spf.protection.outlook.com -all- TTL: Microsoft recommends at least 3,600 seconds (one hour).
If other services send as your domain, add them to the same value, before the -all. Example with an on-premises server and a sending tool:
v=spf1 ip4:203.0.113.10 include:spf.protection.outlook.com include:servers.example-tool.com -allFor the exact clicks at your DNS host, see our guides for Cloudflare, GoDaddy and Namecheap.
Step 3: edit an existing SPF record
Never create a second record. With two SPF records on the same domain, the check returns a permanent error (permerror) and fails for all your email. Edit the existing line and insert include:spf.protection.outlook.com before the final -all or ~all.
Typing mistakes that Microsoft lists, and that make SPF fail:
| Wrong entry | Problem |
|---|---|
include:spf.protection.outlook.com. | trailing period after the name |
include=spf.protection.outlook.com | equals sign instead of a colon |
include: spf.protection.outlook.com | space after the colon |
Step 4: stay under 10 DNS lookups
Past 10 DNS lookups, SPF fails with a permanent error and receiving servers may reject your email. Each of these counts as one lookup: include:, a, mx, exists and redirect, plus any include: nested inside the ones you cite. ip4: and ip6: addresses don't count.
So fewer than 10 include: entries doesn't guarantee fewer than 10 lookups. Our free SPF checker does the count for you. If you go over, Microsoft suggests moving services to subdomains (each has its own limit), or replacing an include: with the IP addresses of a provider that publishes them. Never do that for Microsoft 365: its sending addresses change often.
-all or ~all?
Microsoft recommends -all (hard fail) for Microsoft 365 domains, as long as you also set up DKIM and DMARC. Its documentation notes that DMARC is effectively ignored for an SPF failure under ~all if the message has no DKIM signature either.
If you're not sure you've listed every sender, start with ~all. Set up DKIM and DMARC in monitoring mode, read the DMARC reports for a few weeks, then switch to -all.
Step 5: check it works
- Run
nslookup -type=TXT your-domain.comagain: exactly one line should start withv=spf1. - Send an email from Outlook to a personal Gmail mailbox, open it, choose Show original and look for
SPF: PASS.
Verify it's fixed. AttackScout reads your SPF record from the internet, counts DNS lookups, spots duplicates and checks the Microsoft 365 DKIM selectors. Free, no account needed. Verify it's fixed
Frequently asked questions
Do I need an SPF record for the .onmicrosoft.com domain?
No. Microsoft manages the SPF record of your-organization.onmicrosoft.com itself, and you can't change it. Only your custom domains need your SPF record.
Are my subdomains covered?
No. Each subdomain that sends email needs its own SPF record: the one for your-domain.com doesn't cover news.your-domain.com.
I have a domain that sends no email. What should I publish?
Microsoft recommends v=spf1 -all on domains that aren't used to send email: nobody is allowed to send as them.
Is SPF enough?
No. Microsoft says so itself: set up DKIM and DMARC too. SPF alone doesn't protect the address the recipient sees.
Technical details
Exact configuration. A single TXT record on the domain:
your-domain.com. 3600 IN TXT "v=spf1 include:spf.protection.outlook.com -all"US government clouds use include:spf.protection.office365.us, and Microsoft 365 operated by 21Vianet uses include:spf.protection.partner.outlook.cn.
Why. SPF (RFC 7208) checks the envelope address (MAIL FROM) of a message. Evaluation stops after 10 DNS lookups (permerror). DMARC treats both -all and ~all as failures.
To check it yourself.
dig +short TXT your-domain.comReference: https://www.rfc-editor.org/rfc/rfc7208
Sources
Accessed November 18, 2026.
- Microsoft Learn, Set up SPF to identify valid email sources for your Microsoft 365 domain (updated July 3, 2026): https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure
- IETF, RFC 7208 (SPF): https://www.rfc-editor.org/rfc/rfc7208