Skip to content
Claim your free business email

SPF PermError: too many DNS lookups, the 10 lookup limit, and how to fix it

SPF PermError and the 10 DNS lookup limit: a chain of ten links whose eleventh link has snapped open.

SPF PermError means a receiving mail server could not evaluate your SPF record, so your mail fails SPF on every message. The most common cause is a record that needs more than 10 DNS lookups once every include is followed. Paste your domain into the SPF checker to see your count, then fix it below.

The error has a handful of other causes, from a second SPF record to an include that points at nothing, and each one has a specific fix. This post covers all of them, starting with the lookup limit, because that is the one most domains hit as they add services. If you are new to the record itself, SPF record: what it is shows one term by term, and the SPF glossary entry and DKIM, SPF and DMARC explained cover what it is for.

What does SPF PermError mean?

SPF PermError is the permanent error result of an SPF check: the domain’s published records could not be correctly interpreted, which is how RFC 7208 §2.6.7 defines it. “Permanent” means a retry will not help. The receiver got an answer from DNS, but the answer breaks one of SPF’s rules, and only a change to your DNS fixes it.

It is different from the results you may already know. A fail or softfail means the record was read and the sending server is not on it. A temperror means DNS did not answer in time, and the receiver may try again later. A permerror means the record itself is broken, so no sending server can ever pass, including the ones you meant to allow.

You see it in the headers of a delivered message, in the Authentication-Results line the receiver adds, and in the SPF column of your DMARC aggregate reports:

Authentication-Results: mx.receiver.example;
       spf=permerror (too many DNS lookups) smtp.mailfrom=example.com;
       dkim=pass header.d=example.com;
       dmarc=pass (p=quarantine) header.from=example.com

In this message DKIM still passed and carried DMARC on its own, which is the only reason it arrived. Every message that relies on SPF alone, or whose DKIM signature breaks on the way, has nothing left to pass with.

What is the 10 DNS lookup limit, and what counts toward it?

The 10 DNS lookup limit is the rule that a receiver evaluating your SPF record may make at most 10 lookups for the terms in it, across every record it includes, and must return PermError at the 11th. RFC 7208 sets it in §4.6.4, and §11.1 explains why: without a cap, one SPF check could be made to send a stream of DNS queries at someone else, so every receiver enforces the same SPF 10 lookup limit, and none of them make an exception for a large sender.

These terms count, one lookup each wherever they appear in the tree:

Which SPF terms count toward the 10 DNS lookup limit
TermCounts?Why
include:Yes, 1The receiver reads the other domain's record
aYes, 1The receiver looks up the host's addresses
mxYes, 1The receiver looks up the domain's mail servers
exists:Yes, 1The receiver checks whether a name resolves
redirect=Yes, 1The receiver reads another record instead
ptrYes, 1A reverse lookup; RFC 7208 says not to use it
ip4:NoThe address is compared, nothing is looked up
ip6:NoThe address is compared, nothing is looked up
allNoIt matches everything that is left
exp=NoRead only after a fail, to explain it

The part that surprises people is the nesting. Your own record may hold five terms, but each include brings in somebody else’s record, and every counting term inside that record counts against your 10 too. A mail host’s include often costs three or four lookups on its own, because their record is itself a list of includes.

Here is a record that looks reasonable and is over the limit. It has seven terms that count:

example.com.  TXT  "v=spf1 a mx include:_spf.mailhost.example include:spf.crm.example include:servers.newsletter.example include:_spf.helpdesk.example include:spf.billing.example ~all"

Followed all the way down, it needs 12 lookups:

example.com                                 12 lookups
├─ a                                        1
├─ mx                                       1
├─ include:_spf.mailhost.example            4  (itself, plus the 3 below)
│  ├─ include:_netblocks1.mailhost.example  1
│  ├─ include:_netblocks2.mailhost.example  1
│  └─ include:_netblocks3.mailhost.example  1
├─ include:spf.crm.example                  2  (itself, plus 1 below)
│  └─ include:spf2.crm.example              1
├─ include:servers.newsletter.example       1
├─ include:_spf.helpdesk.example            2  (itself, plus 1 below)
│  └─ a:out.helpdesk.example                1
└─ include:spf.billing.example              1

Receivers count worst case, as if nothing matched, so the order of the terms does not save you. A message from the first include’s servers may pass before the receiver gets far, while a message from the billing tool, at the end, never gets a result at all. Only terms before all count, because nothing after it is read, and a name included twice is counted twice. Terms that cost nothing, by contrast, can be as many as the record has room for:

v=spf1 ip4:203.0.113.10 ip4:203.0.113.25 ip6:2001:db8::/32 -all
            └──────── 0 lookups: addresses are compared, not looked up ────────┘

There is one more limit inside mx, also in §4.6.4: a domain named by an mx term may have at most 10 mail servers behind it. A domain with more turns that term into a PermError even when the total count is low.

How do I count my SPF lookups?

Count your SPF lookups by following every include, redirect and counting term in the tree and adding them up, which is what the SPF checker does for you. Enter your domain and it reads your record from public DNS, follows each include and redirect the way receivers do, and reports the total as a row such as “12 of 10 DNS lookups”.

Under that row it shows the whole lookup tree, so you can see where the lookups go:

  • Each include on its own line, with what it costs including everything beneath it. The expensive one is usually obvious.
  • A warning at 9. The record still works, but the next service you add will break it.
  • “At least” in front of the number when part of the tree could not be read, or the count ran so far past 10 that the checker stopped following. The verdict is the same either way: over 10 is broken.
  • Loops: an include that points back up the tree, which a receiver would follow until the limit.

The same check lists the record’s other problems in rows of their own: void lookups against their limit of 2, includes whose target has no SPF record or two of them, an mx term with more than 10 mail servers, and the ending of the record. Every problem comes with its fix.

You can count by hand too. Read your record with any DNS lookup tool, then read the record behind each include and redirect, and so on down, adding one for each counting term in the table above. It works, but it is easy to miss a level, and the records of the services you include change without telling you, so a count from last year proves little today.

How do I fix SPF PermError: too many DNS lookups?

Fix SPF PermError too many DNS lookups by taking terms out of the tree until the count is 10 or less: remove includes nobody uses, replace a and mx with the addresses they stand for, and move one stream of mail to a subdomain with a record of its own. Do them in that order, because each one is safer than the next. Whether a DMARC report shows permerror or a tool says SPF too many DNS lookups, the fix is the same.

  1. Remove includes for services that no longer send for you — Ask whoever owns each include, look for that service's mail in a recent DMARC aggregate report, and delete the includes nobody sends through. Each one removed saves its own lookup and every lookup nested beneath it.
  2. Replace a and mx with ip4 and ip6 — If your own servers send mail, list their addresses with ip4 and ip6 instead of making receivers look them up. Addresses cost no lookups, while a and mx cost one each on every check.
  3. Move a stream of mail to a subdomain — SPF is checked against the return path, not the From address. Give one sending service a return path on a subdomain such as news.example.com with its own SPF record, and that record gets 10 lookups of its own. Under relaxed DMARC alignment, a pass there still counts for example.com.
  4. Check the count again — Publish the change, wait for the old record's time to live to pass, and run the SPF checker again until it reports 10 DNS lookups or fewer and no more than 2 void lookups.

In the example, dropping spf.billing.example, which nobody has sent through since the billing system was replaced, saves 1. Two ip4 addresses in place of a and mx save 2, and an mx term only belonged in the record while the servers that receive the mail also sent it. Giving the newsletter its own return path at news.example.com saves 1 more, and the subdomain’s record starts with 10 of its own. Applied together, the fixes give two records, both well inside the limit:

; The root record: 8 lookups, room for two more services
example.com.       TXT  "v=spf1 ip4:203.0.113.10 ip4:203.0.113.25 include:_spf.mailhost.example include:spf.crm.example include:_spf.helpdesk.example ~all"

; The newsletter's own return-path subdomain: 1 lookup, against its own limit of 10
news.example.com.  TXT  "v=spf1 include:servers.newsletter.example ~all"

Before you remove an include, check the service’s setup page for its return path. Many sending services already send with a return path on their own domain, or on a subdomain of yours that carries its own record. For that mail SPF is checked somewhere else, and the include in your root record does nothing at all.

Rasket sending domains are set up this way. The SPF record for mail we send sits at a return-path label of its own under your domain, rasket for new domains, so your root record spends none of its 10 lookups on us (how the custom return path works).

Then check the result with the SPF checker. To plan a record before you publish it, the SPF record generator builds one and counts the lookups its own terms make; the checker is what follows the includes.

Why does SPF flattening go stale?

SPF flattening goes stale because it copies the addresses behind each include into your record on the day you flatten it, and the services behind those includes change their addresses without telling you. Flattening replaces includes with the ip4 and ip6 ranges they resolve to, which brings the count to zero:

; Flattened on 1 March: no lookups, and correct only on 1 March
example.com.  TXT  "v=spf1 ip4:198.51.100.0/24 ip4:192.0.2.0/25 ip4:203.0.113.64/26 ip6:2001:db8:10::/48 ... ~all"

The include was a promise that the service keeps its list current. The copy is not. When the service adds a server, mail from it fails SPF for you, with no error anywhere to tell you why. A flattened record is also long, which brings a second limit into play: RFC 7208 §3.4 advises keeping a name’s TXT answers under 450 bytes, and past that some receivers have to retry the lookup over TCP, or fail it.

If you flatten anyway, flatten only your own fixed servers, which you control, and keep the includes of services that change. A tool that re-flattens on a schedule shrinks the gap but does not close it, and it puts a copy of somebody else’s list in your DNS that you now have to watch.

What else causes an SPF PermError?

Besides the lookup limit, SPF PermError comes from a record receivers cannot parse, two SPF records at one name, an include that points at a name with no SPF record, too many void lookups, or an mx term with more than 10 mail servers. Each is a DNS change away from fixed:

Common causes of SPF PermError and their fixes
ProblemWhat receivers seeFix
More than 10 DNS lookupsThe 11th counting term in the treeRemove unused includes, swap a and mx for ip4, move a stream to a subdomain
Two SPF records at one nameTwo TXT records starting v=spf1Merge them into one record that lists every sender
A term that does not parseA typo such as ip4:203.0.113 or inclde:Correct the term; check a long record split into strings kept its spaces
An include with no SPF record behind itThe included name answers, but not with v=spf1Copy the service's current value, or remove the include
More than 2 void lookupsNames that answer nothing at allRemove includes and hosts that no longer exist
An mx term with more than 10 mail serversThe domain's MX list is too longReplace the mx term with the senders' ip4 and ip6 ranges
An include that points back at youA loop, followed until the limitRemove the include that points back up the tree

Two SPF records usually appear when a new service’s setup page says “add this TXT record” and someone adds it beside the old one instead of merging. The receiver cannot know which one you meant, so it uses neither. Put the new include into the existing record, before its all, and delete the second record.

What is the SPF void lookup limit of 2?

The SPF void lookup limit is a second cap in RFC 7208 §4.6.4: receivers should allow at most 2 lookups that come back empty, and return PermError at the third. A void lookup is one where the name does not exist at all, or exists but has no record of the type asked for. The RFC lets a receiver configure the number but recommends 2, so plan for 2.

The limit exists for the same reason as the first: a record full of names that answer nothing costs receivers work for no result. It is separate from the 10 lookup limit, so a record can be well under 10 and still fail on voids:

example.com.  TXT  "v=spf1 include:_spf.mailhost.example include:spf.oldtool.example a:relay.example.com include:spf.retired.example ~all"

; spf.oldtool.example   → no such name (NXDOMAIN)     void 1
; relay.example.com     → name exists, no A record     void 2
; spf.retired.example   → no such name (NXDOMAIN)     void 3: PermError

Void lookups almost always mean something you once used has gone: a tool you cancelled whose domain no longer publishes a record, or a relay host that was switched off and removed from DNS. The fix is to remove those terms. The SPF checker lists every void name it finds and warns at 1 or 2, before the third one breaks the record.

What happens to my mail while SPF is broken?

While your SPF record returns PermError, your mail fails SPF everywhere, and whether it still arrives depends on DKIM. A message with a valid DKIM signature for your From domain can still pass DMARC and be delivered. A message without one has nothing left to pass with.

  • DMARC. A PermError counts as SPF not passing. With aligned DKIM, DMARC passes anyway. Without it, DMARC fails, and receivers apply your policy: nothing at p=none, the spam folder at p=quarantine, a refusal at p=reject.
  • Gmail and Yahoo. Both require every sender to authenticate with SPF or DKIM, and bulk senders to have both, plus a DMARC record. A broken SPF record leaves a bulk sender short of what they ask for, whatever DKIM does.
  • Outlook.com. For domains sending more than 5,000 messages a day it requires SPF to pass, and says mail that does not meet its requirements goes to Junk first and may later be rejected.
  • Forwarded mail. SPF already fails after forwarding, so a working DKIM signature is what those messages rely on in any case.

Nothing bounces just because of the PermError, so the problem is easy to miss: you see it as mail landing in spam, a DMARC report full of permerror, or a customer saying your messages stopped arriving. That is why it is worth checking the record after every change to it, not only when something goes wrong. Each time you add a service, or a service tells you to change its include, run the record through the checker before and after.

Check yours

SPF checker

Is my SPF record valid, and is it under the 10-lookup limit?

Build an SPF record

Published Updated 13 min readBy the Rasket team

Written for developers, startup founders and e-commerce teams

Frequently asked questions

Is there a quick spf permerror fix?

The quickest safe spf permerror fix is to remove includes for services that no longer send your mail, then replace a and mx terms with the ip4 and ip6 addresses they stand for. Run the SPF checker after each change: it shows which include costs the most lookups.

Is SPF PermError the same as an SPF fail?

No. A fail means the record was read and the sending server is not on it. A PermError means the record itself could not be evaluated, so no server can pass, including the ones you listed. Receivers and DMARC treat both as SPF not passing.

Can I ask receivers to allow more than 10 lookups?

No. RFC 7208 requires every receiver to stop at 10 DNS lookups and return PermError, and the limit applies to every domain the same way. The only way under it is to make your record cost fewer lookups, or to move some mail to a subdomain with its own record.

Can I publish two SPF records to get more lookups?

No. Two TXT records starting v=spf1 at the same name is itself a PermError, because receivers cannot tell which one you meant. A long record can be split into several quoted strings inside one TXT record, which receivers join back together, but it is still one record with one limit.

Do ip4 and ip6 terms count toward the SPF lookup limit?

No. An ip4 or ip6 term is compared with the sending server's address directly, so it costs no DNS lookup, and neither do all or the exp modifier. Only include, a, mx, ptr, exists and redirect count, one each, wherever they appear in the tree.

Does it matter whether my record ends in ~all or -all?

Not for a PermError. The error happens before the receiver reaches the ending, so ~all and -all fail the same way. Once the record is fixed, either ending works with DMARC, which treats a softfail and a fail alike as SPF not passing.

How long does it take for an SPF fix to work?

As long as the old record's time to live, often an hour or less. Receivers that read the old record keep using it until their cached copy expires. Check the new record with the SPF checker once it is published, then watch the next DMARC aggregate report for pass.

Sources

  1. RFC 7208: Sender Policy Framework (SPF), sections 2.6.7, 3.4, 4.6.4, 5.2 and 11.1 — IETF, read 2026-11-19
  2. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC) — IETF, read 2026-11-19
  3. Email sender guidelines (Gmail) — Google, read 2026-11-19
  4. Sender Best Practices — Yahoo, read 2026-11-19
  5. Outlook's New Requirements for High-Volume Senders — Microsoft, read 2026-11-19
  6. Rasket docs: Domains (guide) — Rasket, read 2026-11-19
  • SPF — SPF is a TXT record listing which servers may send mail for a domain. A receiving server looks up the record for the return path domain and checks whether the…
  • DKIM, SPF and DMARC explained (2026 Full Guide) — What SPF, DKIM and DMARC each check, how to read the verdicts on a sent message, the records to publish, and what Gmail and Outlook.com require of senders.
  • Custom return path: why your bounces need it — What the return path is, how it differs from the From header, why a return path on your own subdomain makes SPF count toward DMARC, and the records it needs.
  • Gmail bulk sender requirements (2026 Full Guide) — What every Gmail sender must do, what bulk senders add, and Yahoo and Outlook.com side by side: SPF, DKIM, DMARC, unsubscribe, spam rate and error codes.
  • Emails going to spam? (2026 Full Guide) — Why emails land in spam or junk: read the headers to see which problem you have, then the fixes Gmail, Outlook and Yahoo document, in order.

Start sending this morning

Sign up, verify a domain and send your first email in minutes.