
An SPF permerror is the result a receiving server returns when it cannot interpret the SPF record your domain publishes. The most common cause is a record that needs more than 10 DNS lookups to evaluate. The others are syntax mistakes, a second record on the same name, and an include or redirect that points at a domain with no record.
The error is permanent in the literal sense: a retry gives the same answer. This guide lists every cause the standard defines, shows how to count lookups, and gives the repair for each.
What does an SPF permerror mean?
The result means the record itself is broken, not that the sending server is unauthorized.
SPF is the DNS record that lists the servers allowed to send mail for a domain, and it is defined in RFC 7208. Section 2.6.7 says a permanent error means the published records could not be correctly interpreted, and that it needs the DNS operator to step in.
Two error results exist, and they are fixed in different ways:
| Result | Section | What happened | Who fixes it |
|---|---|---|---|
permerror |
2.6.7 | The record could not be interpreted | The domain's DNS operator |
temperror |
2.6.6 | A transient error, usually DNS, during the check | Nobody; a later retry may succeed |
Receivers write the result into the Authentication-Results header. RFC 8601 section 2.7.2 lists the 8 values SPF can take there, and this is how the broken one looks:
Authentication-Results: mx.google.com;
dkim=pass header.i=@example.com header.s=k1;
spf=permerror smtp.mailfrom=example.com;
dmarc=pass (p=NONE) header.from=example.com
In this header DKIM carried the message. Under RFC 7489 section 6.6.2, DMARC can only pass after one of the two mechanisms passes for an aligned domain. A permanent error is never a pass, so a sender with no aligned DKIM signature gets a DMARC fail too.
What are the 8 causes?
Every cause is a rule in RFC 7208 that the published record breaks. One failing record can break more than one, so check the list in order.
| # | Cause | Section |
|---|---|---|
| 1 | More than 10 terms that need a DNS lookup | 4.6.4 |
| 2 | More than 2 void lookups | 4.6.4 |
| 3 | More than 1 record starting with v=spf1 on the name |
4.5 |
| 4 | A syntax error anywhere in the record | 4.6 |
| 5 | An include that points at a domain with no SPF record |
5.2 |
| 6 | A redirect to a domain with no SPF record, or redirect used twice |
6 and 6.1 |
| 7 | An mx term that leads to more than 10 address records |
4.6.4 |
| 8 | A broken macro, such as a % not followed by {, %, - or _ |
7.3 |
Cause 1 is the one we find most often on domains that have added tools over several years. Cause 3 has its own guide, multiple SPF records, because the repair is a merge. This page covers the other 7.
A void lookup is a DNS query that returns no records: either an empty answer or a name that does not exist. The standard says receivers should allow 2 of them and return a permanent error on the third. An include that points at a hostname a vendor deleted is the usual source.
How do you count the DNS lookups in an SPF record?
Count every term that makes the receiver query DNS, including the terms inside each include. The SPF lookup limit is 10 for the whole evaluation, and section 4.6.4 names which terms count.
| Term | Counts toward the 10? |
|---|---|
include: |
Yes, 1, plus every counted term inside the included record |
a and mx |
Yes, 1 each |
exists: |
Yes, 1 |
redirect= |
Yes, 1 |
ptr |
Yes, 1, and section 5.5 says it should not be published at all |
ip4: and ip6: |
No |
all |
No |
exp= |
No |
The nesting is what catches people. Microsoft's SPF setup page puts it plainly: having fewer than 10 include statements does not guarantee fewer than 10 DNS lookups. An include that holds 3 more includes costs 4.
Take this record:
example.com. TXT "v=spf1 a mx include:_spf.google.com include:sendgrid.net include:spf.crm.example include:spf.helpdesk.example include:spf.billing.example ~all"
It shows 7 terms that need a lookup. The true count depends on what sits inside each include. When we queried the two public ones on November 27, 2026, the answers were these:
| Include | Counted terms inside it | Total cost |
|---|---|---|
include:_spf.google.com |
0; the record lists only ip4 and ip6 ranges |
1 |
include:sendgrid.net |
1 further include | 2 |
So the first 4 terms cost 5. If the 3 vendor includes cost 2 each, the record needs 11 lookups and every check that reaches the end of it fails with a permanent error. Providers change these records without notice, so a count is only good for the day it was made.
To count your own, query each include by hand and add up the terms:
$ dig +short TXT _spf.google.com
"v=spf1 ip4:74.125.0.0/16 ip4:209.85.128.0/17 ip6:2001:4860:4864::/56 ~all"
The output above is shortened to 3 ranges. The SPF record checker follows every include and reports the total for you. A tool that reports SPF too many DNS lookups is describing cause 1.
How do you fix too many DNS lookups?
Remove lookups until the total is 10 or fewer, starting with the ones that cost nothing to lose. There are 4 repairs, and we apply them in this order.
- Delete includes for tools that no longer send. Match each include to a tool the business still pays for. A cancelled tool's include is pure cost.
- Drop
aandmxif those servers do not send mail. Many records carry both out of habit. If your mail leaves through a mailbox provider, the web server and the inbound mail servers are not senders. - Replace
aormxwithip4when the server's address is fixed. Anip4term costs 0 lookups. - Move a sender to a subdomain. A newsletter tool that sends as
news.example.comreads that name's record. Microsoft's page notes that each subdomain has its own budget of 10.
RFC 7208 section 10.1.1 ranks the options for a domain with 2 mail servers, and its order matches the list above:
| Record | The RFC's label |
|---|---|
v=spf1 ip4:192.0.2.1 ip4:192.0.2.129 -all |
Best |
v=spf1 a:authorized-spf.example.com -all |
Good |
v=spf1 mx:example.com -all |
Expensive |
v=spf1 ip4:192.0.2.0/24 mx -all |
Wasteful, bad |
The worked example from the previous section, after repairs 1 and 2:
example.com. TXT "v=spf1 include:_spf.google.com include:sendgrid.net include:spf.crm.example ~all"
A fifth option exists, called flattening: copying a provider's IP ranges into your own record in place of its include. Treat it with care. The copied list goes stale the day the provider changes its ranges, and nothing warns you. Microsoft's SPF page describes flattening and says not to flatten spf.protection.outlook.com.
Keep the record short while you are there. Section 3.4 says the answer should fit within 512 octets, and a single string inside a TXT record holds at most 255 octets under section 3.3.
How do you fix the other causes?
Find the term that breaks the rule and correct or remove it. Section 4.6 says a syntax error anywhere in the record returns the error at once, before any term is evaluated, so one typo disables the whole record.
Microsoft's SPF page lists the first 3 syntax mistakes below. We have added the others the standard rules out:
| Mistake | Broken | Correct |
|---|---|---|
= after include |
include=sendgrid.net |
include:sendgrid.net |
| A space after the colon | include: sendgrid.net |
include:sendgrid.net |
| A trailing period after the domain | include:sendgrid.net. |
include:sendgrid.net |
| A partial IP address | ip4:192.0.2. |
ip4:192.0.2.0/24 |
| A mechanism that does not exist | ipv4:192.0.2.1 |
ip4:192.0.2.1 |
redirect= written twice |
Two redirects | One, at the end |
The standard defines 8 mechanisms: all, include, a, mx, ptr, ip4, ip6 and exists. Anything else in a mechanism's place fails the syntax check. Unknown modifiers, the terms written with =, are the exception, and section 6 says receivers must ignore them.
Cause 5, an include with no record behind it. Section 5.2 says that when the included domain returns none, the outer check returns a permanent error. This happens when a vendor retires a hostname or when the include has a typo.
Query the include's target, and if it returns no v=spf1 line, remove the include or get the current name from the vendor.
Cause 6, a bad redirect. A redirect hands the whole decision to another domain's record. Section 6.1 says that if the target has no record, the result is a permanent error and not none.
The same section says a redirect is ignored when the record contains all, so a record with both is a sign that someone misread what redirect does.
Cause 7, a large mx. If the mx term resolves to more than 10 address records, the mechanism returns the error. Replace mx with the sending addresses as ip4 terms.
Cause 8, macros. Few senders write macros by hand. If your record contains a % and you did not put it there deliberately, a vendor's instructions were pasted wrongly.
Why does it fail for some messages and pass for others?
A record over the limit fails only when the receiver has to read far enough to hit the 11th lookup. Evaluation runs left to right and stops at the first match. Microsoft's SPF page makes the same point: an over-limit record may not produce the error for every source.
In practice, mail from the sender listed first passes, and mail from the sender listed last fails. That is why the fault survives for months. The mailbox provider sits at the front of the record and the newest tool at the back, so everyday mail looks fine while the newsletter fails.
Test with a message from each tool in the record, not one. A pass for one sender says nothing about the next.
What do Gmail, Microsoft and Yahoo do with a permanent error?
None of the three publishes a rule for this result by name, and the standards leave the choice to the receiver. RFC 7208 section 8.7 says a receiver that rejects for this reason should reply 550 with the enhanced code 5.5.2. Its Appendix G.3 notes that delivering the message is the less intrusive choice.
As of November 27, 2026, this is what each provider's own pages say:
| Provider | What it publishes | Source |
|---|---|---|
| Microsoft | Over 10 lookups, the message fails SPF with a permanent error; only 1 record is allowed per domain or subdomain | Set up SPF |
| Microsoft | The header value spf=permerror means a permanent error, for example a badly formatted record |
Anti-spam message headers |
| The specification allows a maximum of 10 DNS lookups, and nested lookups count | Troubleshoot SPF issues | |
| Yahoo | All senders need SPF or DKIM at a minimum; bulk senders need both | Sender Best Practices |
Google's troubleshooting page adds a detail worth knowing. It says that with too many lookups, some providers may warn that you have no SPF record even though you do. So a report of a missing record on a domain that has one is a reason to count lookups.
Gmail's SMTP error reference does not use the word permerror. Its refusals say only that SPF did not pass:
550-5.7.26 This email has been blocked because the sender is unauthenticated.
550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM.
The safe reading is that a broken record counts for nothing. A domain with aligned DKIM keeps passing DMARC. A domain that relied on SPF alone has no authentication at all until the record is repaired.
The order we work in on a client domain
We count before we edit, and we test every sender after. A permanent error is rarely the only fault on a domain that has one, so the repair is a small audit.
- We pull the TXT records for every name that sends mail, subdomains included, and count the
v=spf1lines on each. - We expand every include and total the lookups, noting the date, since vendor records change.
- We ask which tools still send. Each include is matched to a live tool or removed.
- We publish the shorter record, then pull a header from each sender and read the
spf=result. - We check the DMARC reports over the following days for any source that stopped passing.
On one multi-domain engagement in our case studies, the share of domains passing authentication checks measured 63% before the work and 100% after it. The same engagement took the count of unmanaged sending services from 5 to 0. Unmanaged senders are where surplus includes come from.
The error returns when the next tool is added without a count. The lasting repair is a written list of every service that sends as the domain, and a lookup count each time the list changes.
To see where your domain stands now, the free email deliverability test reads SPF, DKIM and DMARC in one pass. Our guide to SPF, DKIM and DMARC explains how the three depend on each other.
Drafted with AI assistance from our own records and client work, then reviewed and approved by Kunal Arora. See our editorial policy.