SPF Record Examples for Google, Microsoft 365 and More
TL;DR: An SPF record is one TXT record at your domain that lists who may send mail for it. For Google Workspace only:
v=spf1 include:_spf.google.com ~all
For Microsoft 365 only:
v=spf1 include:spf.protection.outlook.com -all
Keep one SPF record per name, stay under 10 DNS lookups, and check it with dig +short TXT example.com or our email check.
What is an SPF record
SPF (Sender Policy Framework) is defined in RFC 7208. Its a TXT record on your domain that starts with v=spf1. A receiving mail server reads it and checks if the server that sent the message is on your list.
SPF checks the envelope sender (the MAIL FROM address), not the From: address people see. That's why SPF alone does not stop spoofing. You need DMARC on top, see our DMARC record examples.
A record has three parts:
v=spf1, always first.- Mechanisms that list senders:
include:,ip4:,ip6:,a,mx. - An
allat the end that says what to do with everyone else.
SPF record examples
Google Workspace
This is the record from Google's SPF setup page. Google recommends ~all.
v=spf1 include:_spf.google.com ~all
Microsoft 365
From Microsoft's SPF docs. Microsoft recommends -all, because they also expect you to set up DKIM and DMARC.
v=spf1 include:spf.protection.outlook.com -all
Google Workspace plus a newsletter tool
You add one include: per service. The include value comes from the service's own docs. SendGrid uses include:sendgrid.net, for example.
v=spf1 include:_spf.google.com include:sendgrid.net ~all
Your own mail server with ip4 and ip6
ip4: and ip6: take a single address or a CIDR range. They cost no DNS lookups.
v=spf1 ip4:203.0.113.10 ip4:198.51.100.0/24 ip6:2001:db8::/32 include:spf.protection.outlook.com -all
Multiple domains
SPF does not cover other domains or subdomains. Each name that sends mail needs its own record. If example.com and example.net both send through Google, both get the record:
example.com. TXT "v=spf1 include:_spf.google.com ~all"
example.net. TXT "v=spf1 include:_spf.google.com ~all"
news.example.com. TXT "v=spf1 include:sendgrid.net -all"
If you have many domains with the same senders, you can point them at one shared policy with redirect=:
example.net. TXT "v=spf1 redirect=_spf.example.com"
redirect counts as one lookup.
A domain that sends no mail
Parked domains should say so. This stops anyone from using them in the envelope sender:
v=spf1 -all
Real SPF records (December 5, 2026)
We ran dig +short TXT <domain> on December 5, 2026:
google.com "v=spf1 include:_spf.google.com ~all"
microsoft.com "v=spf1 include:_spf-a.microsoft.com include:_spf-b.microsoft.com include:_spf-ssg-a.msft.net include:_spf1-meo.microsoft.com -all"
cloudflare.com "v=spf1 ip4:199.15.212.0/22 ip4:173.245.48.0/20 include:_spf.google.com include:spf1.mcsv.net include:spf.mandrillapp.com include:mail.zendesk.com include:stspg-customer.com include:_spf.salesforce.com -all"
stripe.com "v=spf1 ip4:198.2.180.60/32 ip4:13.111.2.227/32 include:spf1.stripe.com include:greenhouse-outbound-mail.stripe.com include:_spf.qualtrics.com ~all"
GitHub's record is long, so DNS returns it as two strings:
"v=spf1 ip4:192.30.252.0/22 ... include:servers." "mcsv.net include:mktomail.com ..."
That's fine. One TXT string can hold at most 255 characters, so longer records get split. RFC 7208 says the strings are joined with no space in between. So servers. + mcsv.net reads as servers.mcsv.net. Watch the spaces when you split by hand.
~all vs -all
The all at the end matches every sender you did not list. The prefix decides the result:
| Qualifier | Result | Meaning |
|---|---|---|
-all |
fail | Not allowed. Receiver may reject. |
~all |
softfail | Probably not allowed. Usually accepted but marked. |
?all |
neutral | No opinion. Only for testing. |
+all |
pass | Anyone may send. Never use this. |
Which one to pick? Big providers don't agree. Google uses and recommends ~all. Microsoft recommends -all. Look at the real records above: google.com and stripe.com use ~all, microsoft.com and cloudflare.com use -all.
Our take: if you have DMARC with p=quarantine or p=reject, DMARC decides what happens to failing mail, and both work. Start with ~all while you're still finding all your senders. Move to -all once your DMARC reports show nothing legit failing.
The 10 DNS lookup limit
RFC 7208 allows at most 10 mechanisms and modifiers that need a DNS lookup. These count: include, a, mx, ptr, exists and redirect. ip4, ip6 and all don't count. Go over 10 and SPF returns permerror, which many receivers treat as a fail.
Nested includes count too. If you include a service and its record has three more includes, that's four lookups, not one.
On December 5, 2026, _spf.google.com and spf.protection.outlook.com each listed IP ranges directly, so each cost one lookup. That can change any time, the provider controls it.
Ways to get back under 10:
- Remove services you stopped using. This is the most common win.
- Move marketing mail to a subdomain like
news.example.com. It gets its own 10 lookups. - Replace an
include:withip4:ranges, but only for a vendor with fixed, documented IPs. Microsoft says not to do this for Microsoft 365. - Drop
ptrcompletely. The RFC says it should not be used.
The RFC also limits "void lookups", lookups that return nothing, to 2. An include: of a domain with no SPF record is a common cause.
How to check yours
From a terminal:
dig +short TXT example.com | grep spf1
You should see exactly one line that starts with v=spf1. For a subdomain, query that name, the parent's record doesn't apply.
Or use our checker. It shows your SPF record next to DMARC and MTA-STS: /check/email/github.com. Swap in your own domain, or start from the email security tool page.
Common mistakes
- Two SPF records. Adding a second
v=spf1TXT record for a new service is the classic one. Two records meanspermerror. Merge them into one. - Typos in the syntax.
include=instead ofinclude:, a space after the colon, or a trailing dot likeinclude:spf.protection.outlook.com. - Using
+all. It allows every server on the internet. - Forgetting subdomains.
mail.example.comdoesn't inherit the record fromexample.com. - Old includes. A service you left two years ago still in the record, eating lookups.
- SPF only. SPF without DKIM breaks on forwarding. Set up DKIM too, see how to check a DKIM record.
FAQ
What is an SPF record?
A TXT record at your domain, starting with v=spf1, that lists the servers allowed to send mail for that domain. Receivers use it to spot forged envelope senders.
Can I have multiple SPF records for one domain?
No. One name must have one SPF record. Put every sender in it with several include: entries. Different domains and subdomains each have their own single record.
How do I add an SPF record for Office 365 and Google Workspace together?
Put both includes in one record: v=spf1 include:spf.protection.outlook.com include:_spf.google.com ~all. That costs two lookups today.
Should I use ~all or -all?
Both are fine when DMARC is enforced. Use ~all while you're still finding senders, then -all when your DMARC reports are clean.
Does SPF need DMARC?
SPF works alone, but it only checks the hidden envelope sender. DMARC ties it to the visible From: domain and tells receivers what to do on failure. Gmail requires SPF or DKIM for all senders, and DMARC for bulk senders.
Is your site affected? Run the free P-256 check.