SPF PermError: Why Too Many DNS Lookups Break Mail

SPF records that exceed 10 DNS lookups return PermError, and receiving servers often treat that the same as a failed check. Here is how to count your lookups and fix a record before it breaks delivery.

You add one more email tool, generate its SPF snippet, and paste it into your existing record. Mail starts bouncing a week later, or worse, starts landing in spam with no warning. You check your SPF record and it looks fine syntactically. The real problem is invisible until you count something nobody counts by hand: how many DNS lookups your SPF record triggers.

An SPF PermError is a permanent error a receiving mail server returns when your domain's SPF record needs more than 10 DNS lookups to evaluate. RFC 7208, the SPF specification, sets that limit deliberately, and once you cross it, most receiving servers stop trusting your authentication entirely rather than trying to figure out which part still works. The frustrating part is that the record can look completely correct in a text editor — no typo, no missing quote — and still fail purely on lookup count, which is why this cause gets missed long after the more obvious syntax errors have been ruled out.

What Is an SPF PermError?

An SPF PermError is the result code a receiving mail server returns when it cannot finish evaluating your SPF record because the record is malformed or exceeds the processing limits defined in RFC 7208. The most common trigger is the 10 DNS lookup ceiling, not a typo or a missing quote.

Unlike SPF Fail, which means the sending server is not authorized, PermError means the receiving server gave up on evaluation altogether. Some mail providers treat PermError as equivalent to Fail. Others quarantine the message. Very few treat it as harmless, because from the receiver's side a record it cannot finish checking is indistinguishable from a record hiding something.

RFC 7208 also caps a second, smaller total inside the same evaluation: void lookups, meaning DNS queries that return no answer at all, are capped at 2. A record can sit under 10 total lookups and still fail from dead-end queries left behind by a decommissioned vendor or subdomain.

Why Does SPF Have a 10 DNS Lookup Limit?

The 10 lookup limit exists to stop SPF checks from becoming a denial-of-service vector. Every incoming message triggers an SPF evaluation, and if a malicious or careless record chained hundreds of DNS lookups, a receiving mail server would burn CPU and network time on every single message it processes.

Not every SPF mechanism counts against the limit. Mechanisms that require a DNS query to resolve count; mechanisms that are already a static value do not.

MechanismCounts as a lookup?Common source
include:YesThird-party senders (Google Workspace, SendGrid, HubSpot)
aYesDomain name resolution
mxYesMail server resolution
ptrYes, and deprecatedReverse DNS checks; RFC 7208 advises against it
exists:YesConditional macro-based checks
redirect=YesDelegates the rest of evaluation to another record
ip4: / ip6:NoStatic IP addresses, no query needed
allNoCatch-all qualifier at the end of the record

Each include: also inherits the lookups of the record it points to. A single third-party include can silently cost two or three lookups on its own, which is how a record with five visible entries ends up needing twelve.

How Do You Know Your SPF Record Is Close to the Limit?

Most teams find out from a symptom, not a count: a vendor reports bounced mail, or a customer says your email landed in spam. By the time that happens, the record has usually been over the limit for a while, because SPF failures are silent to the sender. Your outgoing mail server never sees the receiving side's evaluation.

Manually counting lookups means walking every include: chain by hand with a DNS tool, adding up each mechanism, and repeating the walk every time a vendor changes their own SPF record upstream, since their changes affect your total without you touching your own DNS. This is the part of SPF hygiene that gets skipped, because it has to be repeated on a schedule to catch drift rather than done once.

EmailControl checks the resolved lookup chain behind your SPF record on the schedule your plan runs, not just the syntax, and flags a record that is at or past the 10 lookup ceiling before a receiving server starts rejecting your mail. See how the check works on the FAQ page if you are not sure where your own record stands right now.

How Do You Fix an SPF Record That Exceeds the Limit?

Fixing an over-limit record is a matter of reducing lookups, not rewriting your whole authentication setup. Work through it in this order:

  1. List every mechanism in your current record and mark which ones consume a lookup, using the table above.
  2. Remove any include: for a vendor you no longer use — old marketing tools and abandoned trial accounts are the most common dead weight.
  3. Replace a stable vendor's include: with the vendor's published static IP ranges as ip4: or ip6: entries, if the vendor documents them, since static IPs cost nothing against the limit.
  4. Consolidate multiple sending sources under a single subdomain SPF record and reference it once with redirect=, instead of stacking separate includes at the root.
  5. Republish the record and re-run the lookup count to confirm you are under 10, including the lookups nested inside any remaining includes.
  6. Re-check on a schedule going forward, since a vendor can add lookups to their own record without notifying you, pushing your total back over the limit months later.

Flattening — replacing an include: with the vendor's current IPs — works, but it goes stale. If the vendor rotates their sending IPs and you never update the static list, mail from their new IPs starts failing SPF even though your lookup count looks fine. Flatten only vendors whose ranges rarely change, and recheck flattened entries periodically rather than treating them as permanent.

Order matters here for another reason: fixing the highest-cost mechanism first, usually the largest third-party include, gets you back under the limit fastest, while cleanup of smaller unused entries can happen on a normal maintenance schedule instead of under pressure. Treat the first pass as damage control and the second pass as routine hygiene.

What Should You Do If You Are Not Sure Where to Start?

Some teams read this and assume manual DNS queries are good enough, since SPF changes are infrequent. That is true right up until a new vendor is added, or an existing vendor quietly expands their own include chain — at which point the record breaks with no alert, and the first sign is a support ticket about missing email. A one-time manual count catches the problem on the day you run it and misses every day after.

Automated, scheduled checking closes that gap without adding operational overhead: instead of remembering to re-walk your SPF chain every time you touch a DNS record, the check runs on its own and tells you the moment a total crosses 10.

This applies just as much if you manage more than one domain. Each domain has its own SPF record and its own lookup count, so a fix made on one domain last quarter does not protect the others, and a vendor change that pushes one domain over the limit can leave a second, unrelated domain untouched. Tracking that by hand across several domains is where manual checking stops scaling.

Start free monitoring on a domain and see your current SPF, DKIM, and DMARC status, including the resolved lookup count, in the first check. It takes a couple of minutes to add a domain and see where you stand.

Frequently asked questions

What is an SPF PermError?

An SPF PermError is a permanent error code a receiving mail server returns when it cannot finish evaluating your SPF record, most often because the record needs more than the 10 DNS lookups allowed by RFC 7208. Some receivers treat PermError as equivalent to a failed check, which can send legitimate mail to spam or trigger a rejection.

How many DNS lookups does SPF allow?

RFC 7208 sets a hard limit of 10 DNS lookups per SPF evaluation, counting mechanisms like include, a, mx, ptr, exists, and redirect. There is also a separate sub-limit of 2 void lookups, meaning DNS queries that return no result. Static mechanisms like ip4 and ip6 do not count toward either limit.

Does an SPF PermError block all of my email?

It depends on the receiving mail server's policy, not on your domain. Some providers treat PermError the same as SPF Fail and reject or quarantine the message; others are more lenient. Because the behavior is inconsistent across receivers, an SPF PermError should be treated as a real delivery risk rather than a cosmetic warning.

Can I use ip4 and ip6 mechanisms to stay under the lookup limit?

Yes. Static IP entries using ip4: or ip6: do not require a DNS lookup to evaluate, unlike include, a, mx, ptr, exists, and redirect. Replacing a vendor's include with their published static IP ranges is a common way to cut lookups, as long as you recheck those ranges periodically for changes.

What is SPF flattening and is it safe?

SPF flattening means replacing an include mechanism with the actual IP addresses it currently resolves to, removing that lookup from your count. It is safe for vendors with stable IP ranges, but it goes stale if the vendor rotates or expands their sending IPs later, since your flattened record will not include the new ones automatically.

How do I check whether my SPF record is near the 10-lookup limit?

You can manually walk every include chain in your record with a DNS query tool and add up each lookup-consuming mechanism, repeating this whenever a vendor changes their own record. EmailControl automates this by resolving your full SPF lookup chain on a schedule and flagging a record that is at or past the limit.

Want to know the moment your domain lands on a blacklist? Start free monitoring — takes under a minute.