An SPF record is one line of text. It has no loops, no variables you are likely to use, and a grammar a patient person can learn over lunch. It is also the most frequently broken record in email, because that one line is edited by everyone who ever signed up for a tool that sends mail, and none of them read what was already there.
The failures are not random. There are a handful of them, they recur with comic regularity, and each has a definite fix. This is the field guide. To test your own record as you read, open the SPF checker in another tab.
How SPF fails: the results that matter
A receiver that checks SPF produces one of a handful of results. Three of them are where the trouble is.
| Result | Meaning | Usual cause |
|---|---|---|
fail / softfail | The sending server is not on your list | A sender you forgot, or forwarding |
permerror | The record itself is broken | Two records, too many lookups, bad syntax |
temperror | DNS did not answer in time | A slow or failing nameserver, often inside an include |
none | No SPF record was found | Record missing, or published at the wrong name |
The one to fear is permerror. It does not mean one message failed. It means the record cannot be evaluated, so SPF is unavailable for all your mail until someone fixes it. For DMARC purposes a permerror is not a pass, and your mail is left to rely on DKIM alone. If the basics are unfamiliar, What Is SPF? covers them.
Error 1: Two SPF records
The rule is one SPF record per hostname. Not one per provider. A marketing platform’s setup page says “add this TXT record,” someone adds it, and now there are two:
example.com. TXT "v=spf1 include:_spf.google.com ~all"
example.com. TXT "v=spf1 include:servers.mcsv.net ~all"Receivers do not pick one or combine them. They return permerror. The fix is to merge every mechanism into a single record with a single all at the end:
example.com. TXT "v=spf1 include:_spf.google.com include:servers.mcsv.net ~all"Other TXT records at the same name are fine. Site-verification strings and the like do not count. Only records beginning with v=spf1 do. The SPF record generator will build the merged record for you.
Error 2: More than ten DNS lookups
To keep SPF from becoming a tool for hammering DNS servers, the standard caps evaluation at ten DNS-querying mechanisms. These count: include, a, mx, ptr, exists, and the redirect modifier. These do not: ip4, ip6, and all.
The catch is that the count is recursive. An include that itself contains three includes costs four. Your record may show five includes and cost fourteen:
v=spf1 include:_spf.google.com (costs 4)
include:spf.protection.outlook.com (costs 2)
include:sendgrid.net (costs 1)
include:_spf.salesforce.com (costs 3)
include:servers.mcsv.net (costs 1)
mx a ~all (costs 2) → 13 lookups: permerrorThose per-provider costs are illustrative, and they change whenever a provider reorganizes its records, which is the real hazard. A record that was at nine last year can be at eleven today without anyone on your side touching it.
The fixes, in order of preference:
- Remove senders you no longer use. Most bloated records carry at least one include for a tool cancelled long ago.
- Drop
aandmxunless your web server or inbound mail server really sends mail. They are often there by superstition. - Move senders to subdomains. Send marketing from
news.example.comwith its own SPF record and its own budget of ten. - Use a custom return-path. Many platforms let bounces go to a subdomain of yours that points to their SPF, which takes them out of your root record entirely.
- Flatten with care. Replacing includes with raw IP ranges cuts lookups to zero, and goes stale the day the provider adds a server. Flatten only if something re-checks it for you.
The SPF record is the office refrigerator of DNS. Everyone puts something in. No one takes anything out. Eventually it stops working.
The other limit: void lookups
A lesser-known limit: no more than two lookups may come back empty. An a or mx mechanism naming a host that no longer exists is a void lookup. The third one produces permerror. An include is less forgiving still: if its target has no SPF record at all, the result is a permerror on its own, immediately.
These creep in when a vendor shuts down or renames its SPF hostname. The record looks unchanged. What it points to has gone.
Error 3: The wrong ending
Everything before all says who may send. The qualifier on all says what to do about everyone else.
| Ending | Meaning | Verdict |
|---|---|---|
-all | Fail everything not listed | Correct once your list is complete |
~all | Softfail everything not listed | A sound default alongside DMARC |
?all | No opinion | Nearly useless |
+all | Everyone on earth is authorized | Never. This is an open invitation |
No all | Defaults to neutral | Same as ?all; add one |
A record ending in +all passes SPF for any server anywhere, including the ones run by people forging your invoices. It usually arrives by typo. Check for it anyway. Also note that mechanisms are read left to right and the first match wins, so anything written after all is never reached.
Error 4: Syntax slips and relics
Small mistakes, complete failure. The usual offenders:
- A bad version tag. It must be exactly
v=spf1. Notv=spf 1, notspf1, notv=spf2. - Missing or extra punctuation.
include: example.comwith a space,ip4=with an equals sign, or commas between mechanisms. Mechanisms are separated by single spaces and use colons. - An include for an address.
include:192.0.2.10is wrong. Addresses takeip4:192.0.2.10. - Curly quotes. A record pasted from a word processor may carry typographic quotation marks into the value.
- A string over 255 characters. One TXT string holds at most 255 characters. Longer records must be split into several quoted strings inside the same record, which receivers join with no space added:
"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.0/24 include:_spf.google.com "
"include:spf.protection.outlook.com ~all"Note the space before the closing quote on the first line. Leave it out and the two halves fuse into one unreadable mechanism.
ptr and the retired record type
The ptr mechanism asks the receiver to do a reverse lookup on the sending address. The SPF standard itself says not to use it: it is slow, unreliable, and some large receivers skip it. If your record contains ptr, replace it with the explicit ip4, ip6, or include it was standing in for.
Likewise the dedicated SPF record type. DNS once had a record type named SPF. It has been retired. Publish SPF as a TXT record and nothing else.
Error 5: Right record, wrong place
SPF is checked against the envelope sender, also called the Return-Path or MAIL FROM. It is not checked against the From address your reader sees. That produces two surprises.
First, subdomains do not inherit. A record at example.com says nothing about mail.example.com. If a service sends with a return-path on a subdomain, that subdomain needs its own record.
Second, SPF can pass and still not help you. If your email platform uses its own domain in the Return-Path, SPF passes for the platform’s domain. DMARC wants a pass that matches your From domain, and this one does not. The cure is described in DMARC Alignment Explained. Adding the platform’s include to your root record, the instinctive fix, does nothing here except spend a lookup.
The failure you cannot fix: forwarding
When a recipient’s mailbox forwards your message, the forwarding server delivers it from its own address. That address is not in your record. SPF fails, and no edit you make will change it.
This is by design, and it is the reason SPF should never work alone. A DKIM signature survives forwarding, so DMARC can still pass. Make sure every sender signs with your domain; What Is DKIM? explains how, and SPF vs DKIM vs DMARC shows how the three divide the work.
Keeping it fixed
SPF records decay. Providers change their includes, colleagues add senders, and the lookup count drifts upward. To see what is really happening, read the SPF results in your aggregate reports with the DMARC report analyzer, or inspect one message in the email header analyzer.
To stop checking by hand, SpoofKiller’s SPF monitoring re-evaluates your record on a schedule, walks every include, counts lookups the way receivers do, and alerts you when the answer changes. It is included from the Pro plan; see pricing. A free account still gets you the reports that show which senders are failing.

