SPFEmail authentication explained
What is an SPF record? Format, syntax and examples
An SPF record is one DNS TXT record at a domain that lists the servers allowed to send its mail. The format is v=spf1, then mechanisms such as include:, ip4: and mx separated by single spaces, usually ending in an all term: v=spf1 include:_spf.google.com ~all. Receivers compare the sending IP with that list.
How it looks in DNS
TXT- Name
@- Value
v=spf1 include:_spf.google.com include:_spf.salesforce.com ip4:203.0.113.10 ~all
Google Workspace, Salesforce and your own server: 3 of 10 DNS lookups, everything else soft-fails
Part by part
SPF record format, left to right
v=spf1, then terms separated by single spaces: mechanisms that match senders, then name=value modifiers. The record above, one term at a time.
TXT at @
v=spf1include:_spf.google.cominclude:_spf.salesforce.comip4:203.0.113.10~all
v=spf1The version, always first: exactly v=spf1, in lower case. A record starting v=spf10 is discardedinclude:_spf.google.comGoogle's servers. 1 DNS lookup: its record holds only IP rangesinclude:_spf.salesforce.comSalesforce's servers. 2 DNS lookups: the include plus the exists: term inside. Skip it when Email Security Compliance is on: Salesforce then passes SPF on its own bounce domainip4:203.0.113.10One IPv4 address, /32 without a mask; ip4 and ip6 cost no lookups~allAnything unmatched gets softfail; receivers should not reject on that alone. -all returns fail, ?all neutral, +all passes any server
Examples
SPF record examples for common setups
One record per domain: start from the closest example and add other senders. On 26 November 2026 we followed every include below; cards show lookups out of 10 and what unlisted servers get.
Google and Microsoft 365
source (opens the vendor's page in a new tab)Name
@2 DNS lookupsOthers: softfailv=spf1 include:_spf.google.com include:spf.protection.outlook.com ~allGoogle's own example; both includes hold only IP ranges
Google Workspace setupOwn servers and Microsoft 365
source (opens the vendor's page in a new tab)Name
@1 DNS lookupOthers: failv=spf1 ip4:192.0.2.10 ip4:198.51.100.0/24 include:spf.protection.outlook.com -allMicrosoft's general form, ending in the -all it recommends
Microsoft 365 setupSubdomain for bulk mail
source (opens the vendor's page in a new tab)Name
news5 DNS lookupsOthers: softfailv=spf1 include:mailgun.org ~allThe root keeps its record; this subdomain gets its own 10 lookups
Mailgun setupDomain that sends no mail
source (opens the vendor's page in a new tab)Name
@0 DNS lookupsOthers: failv=spf1 -allMicrosoft's parked-domain record; add DMARC at p=reject
What is DMARCOne policy, many domains
source (opens the vendor's page in a new tab)Name
@1 DNS lookup plus the target'sOthers: the target's resultv=spf1 redirect=_spf.example.comPublish this on each domain; adding all here voids the redirect
Record over 255 characters
source (opens the vendor's page in a new tab)Name
amazonses.com0 DNS lookupsOthers: fail"v=spf1 ip4:199.255.192.0/22 ip4:199.127.232.0/22 ip4:54.240.0.0/18 ip4:69.169.224.0/20 ip4:23.249.208.0/20 ip4:23.251.224.0/19 ip4:76.223.176.0/20 ip4:54.240.64.0/18 ip4:76.223.128.0/19 ip4:216.221.160.0/19 ip4:206.55.144.0/20 ip4:24.110.64.0/18 " "ip4:98.77.0.0/16 -all"Amazon's 267-character record in two strings, the first ending in a space; with three verification records the answer is 523 bytes, over 512
Amazon Route 53 setup
Look up the SPF record of any domain
The same check as our SPF checker: the record is read live from DNS in your browser and every part is explained. Try your own domain, or a big sender to see a working record.
Try
Every include is followed to the end and counted. Lookups go from your browser to Cloudflare's public DNS resolver; nothing is stored.
What you get
The result, in plain words
- Every include followed, with its own lookup count
- Lookups against the limit of 10, void lookups against 2
- Each mechanism and the all ending in plain words
- The corrected record, ready to paste into your DNS
How it works
What a receiving server does with SPF
Read the envelope sendersource (opens the vendor's page in a new tab)
The MAIL FROM (Return-Path) domain, or the HELO name when it is empty
Fetch the recordsource (opens the vendor's page in a new tab)
Only a TXT record starting with v=spf1 counts; two of them are a permerror
Walk the mechanismssource (opens the vendor's page in a new tab)
Left to right; the first match decides. No match and no all or redirect gives neutral
Return a resultsource (opens the vendor's page in a new tab)
pass, fail, softfail, neutral, none, permerror or temperror
Hand it to DMARCsource (opens the vendor's page in a new tab)
DMARC counts an SPF pass only when the Return-Path domain aligns with From
SPF checks only the envelope domain. Mail can pass SPF on a bounce domain, such as Postmark's or Amazon SES's default, and still fail DMARC on yours. DKIM and DMARC close that gap.
Each Return-Path domain and sending subdomain needs its own record, and every include in it costs lookups. Receivers count lookups as they evaluate. A sender matched before the 11th can still pass, mail from the services listed after it gets permerror. Order does not fix an over-limit record.
The SPF checker counts lookups, the SPF record generator rebuilds the record, what causes SPF permerror lists the rest, and SPF flattening is the last resort.
Google "recommends you use ~all"; Microsoft recommends -all for Microsoft 365 because it also recommends DKIM and DMARC. Of 2,969 B2B domains we read in October 2026, 61% of SPF records ended in ~all, 36% in -all, and 2.1% of domains had two records.
How we measured. We drew a random sample of 3,000 company domains from our B2B lead pool (80,425 domains with working MX records, collected in September 2026) and read their SPF and DMARC records from public DNS on October 15, 2026. 2,969 domains gave a usable answer. These are recipient domains, the companies cold emailers write to; our customers' sending domains were not part of the sample, and the pool leans toward small tech and agency companies. DNS changes, so treat the shares as a snapshot. Outreach2day data, October 2026.
Reference
SPF record syntax: mechanisms, modifiers and qualifiers
Single spaces separate terms: [qualifier]name[:domain][/cidr] for mechanisms, name=value for modifiers, placed last. Names ignore case; a syntax error anywhere is a permerror for every message.
v=spf1DNS lookups:0Exactly this, first, in lower case; v=spf10 is discardedinclude:<domain>DNS lookups:1, plus its ownAnother domain's SPF servers; a target with no record is a permerror when reacheda / a:<domain>DNS lookups:1The domain's A and AAAA addressesmx / mx:<domain>DNS lookups:1, max 10 MX hostsThe domain's MX servers, as in v=spf1 mx -allip4:<address or range>DNS lookups:0An IPv4 address or CIDR range; no mask means /32ip6:<address or range>DNS lookups:0An IPv6 address or range; no mask means /128exists:<domain>DNS lookups:1The sender, if the name resolves; Salesforce uses exists:%{i}._spf.mta.salesforce.comptrDNS lookups:1 or moreReverse DNS; RFC 7208 says it should not be publishedallDNS lookups:0Everything, so it goes last; mechanisms after it are ignoredredirect=<domain>DNS lookups:1Another domain's record when nothing matched; ignored if all is present; once at mostexp=<domain>DNS lookups:0 during the checkA TXT record with the text shown on fail; once at most, ignored inside an includeunknown name=valueDNS lookups:0Ignored wherever it appears+ - ~ ?DNS lookups:0Qualifiers: pass (the default), fail, softfail, neutral
Rules and limits
What receivers enforce on SPF
- At most 10 lookup terms (include, a, mx, ptr, exists, redirect, nested too) per evaluation; ip4, ip6, all and exp cost none, and a check reaching the 11th gets permerrorsource (opens the vendor's page in a new tab)
- Receivers should allow 2 void lookups (names with no answer, like a dropped service's include); the third is a permerrorsource (opens the vendor's page in a new tab)
- One SPF record per domain: two return permerror, none returns nonesource (opens the vendor's page in a new tab)
- A TXT string holds 255 characters; longer records use several quoted strings in one TXT record, joined without spacessource (opens the vendor's page in a new tab)
- The answer SHOULD fit in 512 octets; RFC 7208 aims for under 450 for the name plus all its TXT records, verification strings toosource (opens the vendor's page in a new tab)
- Google's help: SPF records "can have up to 255 characters" and the TXT record should be "no larger than 512 bytes"source (opens the vendor's page in a new tab)
- Publish it as TXT; the old DNS SPF record type (99) is no longer usedsource (opens the vendor's page in a new tab)
- Gmail asks every sender for SPF or DKIM, and senders of 5,000+ messages a day to Gmail for both, plus DMARCsource (opens the vendor's page in a new tab)
- Yahoo asks every sender for SPF or DKIM and bulk senders for both, with DMARC that passessource (opens the vendor's page in a new tab)
By provider
The SPF record for each sending service
The values from each provider's own docs. Open a provider for the full records, the steps in its interface and a check pre-set for it.
Microsoft 365v=spf1 include:spf.protection.outlook.com -allSetup
Google Workspacev=spf1 include:_spf.google.com ~allSetupSalesforceinclude:_spf.salesforce.comSetup
PostmarkNo include on your root domain; the Return-Path CNAME carries SPFSetup
MailchimpNo include required by Mailchimp's docsSetup
SendGridCNAME em<0000> to SendGrid; no include on the rootSetup
Amazon SESv=spf1 include:amazonses.com ~allSetup
Mailgunv=spf1 include:mailgun.org ~allSetup
HubSpotinclude:<HubID>.spf0X.hubspotemail.netSetupZoho Mailv=spf1 include:zohomail.com -allSetup
Where the record goes
What to type in each field of your DNS panel:
Troubleshooting
Common SPF errors and fixes
Two SPF records on one domain
Merge them into one v=spf1 record; until then every message gets permerrorsource (opens the vendor's page in a new tab)
Strings joined without a space: "…/18" "ip4:98.77.0.0/16 -all"
They join as /18ip4:98.77.0.0/16, a syntax error. End the first string with a space, or every message gets permerrorsource (opens the vendor's page in a new tab)
include: spf.protection.outlook.com (space after the colon)
Write include:spf.protection.outlook.com; with the space, every message gets permerrorsource (opens the vendor's page in a new tab)
ipv4:192.0.2.10 or ipv6:
Use ip4: and ip6:; other names are a syntax error, so every message gets permerrorsource (opens the vendor's page in a new tab)
include=spf.protection.outlook.com or ip4=192.0.2.10
Use a colon: with = it is an ignored unknown modifier, so only that sender fails SPFsource (opens the vendor's page in a new tab)
v=spf1 -all include:_spf.google.com
Put the include before -all; mechanisms after all are ignored, so only that sender fails SPFsource (opens the vendor's page in a new tab)
Record split into two TXT records
Use one TXT record with several quoted strings; a part without v=spf1 is discarded, so only its senders fail SPFsource (opens the vendor's page in a new tab)
Root include for SendGrid, Postmark or Amazon SES
Remove it: SPF is checked on the service's Return-Path, its own domain or your subdomain, so include:sendgrid.net costs 2 of 10 lookups and changes nothingsource (opens the vendor's page in a new tab)
permerror: too many DNS lookups
Drop unused services, move one to a subdomain, flatten as a last resort; reordering does not help. Permerror once a check reaches the 11thsource (opens the vendor's page in a new tab)
include of a domain with no SPF record
Delete it or use the provider's current include; it is often a void lookup. Permerror once a check reaches itsource (opens the vendor's page in a new tab)
For cold email
Mailboxes that come with the DNS records done
Outreach2day buys the domains, publishes SPF, DKIM and DMARC, creates the mailboxes and starts warmup, then sends your campaigns from its own sequencer or exports the mailboxes to Instantly or Smartlead.
- SPF, DKIM and DMARC set for youOn every domain, checked after setup and kept in place
- $2.50 a mailbox a month12-mailbox minimum; warmup and the sending engine included
- 1,000+ mailboxesA volume price per mailbox, quoted on a call
Questions
How do I create a proper SPF record?
Put the includes of each service whose Return-Path is your domain, and your IPs, in one v=spf1 record ending in ~all or -all. Our SPF record generator counts lookups.
Do I type the quotes around an SPF record?
They are not part of the record. Route 53 wants them, Cloudflare adds them to new records, Squarespace says to remove them if the record fails to resolve.
How long does an SPF change take to work?
Receivers cache the old record until its TTL expires; at the 3,600-second minimum Microsoft recommends, that is up to an hour.
Does SPF pass when an email is forwarded?
Usually not: the forwarder's IP is missing from your record unless it rewrites the envelope sender. DMARC can still pass on aligned DKIM.
Where can I see the SPF result of an email I received?
Received-SPF or Authentication-Results in the headers gives the result and sending IP; in Gmail, use More next to Reply, then Show original.
What does SPF temperror mean?
A temporary DNS failure, such as a timeout, on the record or an include; a later retry can pass with no change.
Sources
The RFCs and the mailbox providers' sender rules, checked . Where a mailbox provider's rules change, its own page is the reference.
- RFC 7208: Sender Policy Framework (rfc-editor.org)
- RFC 7208, TXT strings and record size (rfc-editor.org)
- RFC 7208, DNS lookup limits (rfc-editor.org)
- RFC 7208, all and modifiers (rfc-editor.org)
- RFC 7208, forwarding and mediators (rfc-editor.org)
- RFC 7208, SPF results in message headers (rfc-editor.org)
- RFC 7489: DMARC identifier alignment (rfc-editor.org)
- Google: About SPF records (knowledge.workspace.google.com)
- Google: Set up SPF (knowledge.workspace.google.com)
- Microsoft: Set up SPF for your Microsoft 365 domain (learn.microsoft.com)
- Salesforce: Include Salesforce in your SPF record (help.salesforce.com)
- SendGrid: How to set up domain authentication (twilio.com)
- Postmark: How do I set up SPF for Postmark? (postmarkapp.com)
- Amazon SES: Authenticating email with SPF (docs.aws.amazon.com)
- Gmail Help: Trace an email with its full headers (support.google.com)
- Google: Email sender guidelines (support.google.com)
- Yahoo: Sender best practices (senders.yahooinc.com)
Deliverability call
Talk to our deliverability team
Book a call with the people who run our mailbox infrastructure. We look at your current setup and tell you what to change. Running 1,000+ mailboxes? We also quote a volume price, warmup and sending included.
- Review your domains, DNS records and current inbox placement
- Size the setup: domains, mailboxes per domain and daily volume per mailbox
- Plan warmup and the move from your current provider or sequencer
- 1,000+ mailboxes: a volume price per mailbox for your setup
Free call
See open times in your time zone and book on this page.
Or open the booking pageLoading available times…
Open the booking page instead