actionabletools
Ad Reach small business owners and creators. Put your product on every tool page in your category. Learn more

· 4 min read

SPF PermError: How to Fix "Too Many DNS Lookups" and Other SPF Errors

SPF permerror means receivers can't read your SPF record, so it counts as broken. How to find the cause in a minute, count your lookups, and get back under the limit of 10.

Open the DMARC CheckerFree, no sign-up

SPF permerror means the receiving server couldn’t make sense of your domain’s SPF record, so it gave up. It’s “permanent” because the problem is in the record itself, and every server that checks it will hit the same wall. Nine times out of ten the cause is the same: the record needs more than 10 DNS lookups to check. The fix is to cut the lookups, and you can find them in a minute.

How to fix SPF permerror

  1. Read your SPF record. Run your domain through the DMARC checker. It shows the SPF record next to DMARC, so you can see the whole line.
  2. Check there’s only one. Your domain must have exactly one TXT record starting with v=spf1. If you see two, that alone is a permerror. Merge them into one.
  3. Count the lookups. Every include:, a, mx, ptr, exists: and redirect= costs one, and so do the ones inside each included record. The count section below shows how.
  4. Remove what you don’t use. Old newsletter tools, a CRM you cancelled, a duplicate include for the same provider. This alone often fixes it.
  5. Check again with the DMARC checker, then send a test email and read its headers in the email header analyzer. You want spf=pass.

Why the limit exists

To check SPF, a receiving server has to look up your record, then look up every record it points to, and so on. Without a cap, one badly written record could make every mail server on the internet do hundreds of lookups. So the SPF standard, RFC 7208, sets a limit of 10 lookups per check. Past that, the answer is permerror.

There’s a second, less known limit: no more than two “void” lookups, meaning lookups that come back empty. An include that points at a domain with no SPF record is a void lookup, and it’s often a sign of a cancelled service.

How to count your SPF lookups

Take this record:

v=spf1 include:_spf.google.com include:sendgrid.net include:mailgun.org mx a ~all

It looks like five lookups: three includes, mx and a. But each include can contain more includes inside it, and those count too. A large provider’s include can use several lookups on its own. That’s how a record with four or five services quietly goes over 10.

Costs a lookup Free
include: ip4:
a ip6:
mx all
ptr v=spf1
exists:
redirect=

To count the nested ones, look up each included record in turn (a DNS lookup tool or dig TXT _spf.google.com in a terminal shows it) and add up every mechanism from the table, all the way down.

Ways to get under 10

Remove dead services. Anything you no longer send from. Check with whoever set up the domain before removing a service you don’t recognise.

Drop a and mx if you don’t send from them. Many records include a and mx out of habit. If your website server and your incoming mail servers don’t send your email, they’re two wasted lookups.

Never use ptr. It’s slow, the standard discourages it, and it costs a lookup.

Move bulk senders to a subdomain. Send newsletters from news.yourbusiness.com with its own SPF record. The main domain’s record then only needs your mailbox provider. This also keeps your newsletter’s reputation apart from your everyday email.

Lean on DKIM. Some tools don’t need to be in SPF at all if they sign with DKIM on your domain, because DMARC passes on either one. Check the tool’s setup guide before removing it.

Flatten, carefully. “Flattening” replaces an include with the IP addresses it lists, which cost no lookups. It works, but providers change their IP ranges without telling you, and a flattened record then silently goes out of date. Only do it with a service that refreshes it automatically.

Other causes of permerror

  • Typos. inlcude:, a missing colon, v=spf1 not at the very start, or a stray quote pasted into the DNS panel.
  • SPF in the wrong record type. It must be a TXT record. The old SPF record type is no longer used.
  • A record that’s too long. A single TXT string is limited to 255 characters. Most DNS panels split long values for you, but some don’t.

How to tell if permerror is hurting you

Your DMARC reports show it. Rows with SPF failing for your own servers, while DKIM also fails, are email that is failing DMARC. How to read DMARC reports shows where to look. If DKIM passes on your domain, DMARC still passes, and the permerror is a tidy-up job rather than an emergency. Fix it anyway: the next service you add would depend on SPF alone.

Questions people ask

What does SPF permerror mean?

Permanent error. The receiving server tried to read your SPF record and couldn't, because the record breaks a rule: too many DNS lookups, two SPF records, or a typo. It won't fix itself on a retry, unlike a temporary error.

What is the SPF 10 lookup limit?

The SPF standard (RFC 7208) lets a receiver do at most 10 DNS lookups while checking one SPF record. Each include, a, mx, ptr, exists and redirect counts, including the ones inside the records you include. Over 10 is a permerror.

Do ip4 and ip6 count towards the 10 lookups?

No. ip4, ip6 and all need no DNS lookup, so they're free. That's why replacing an include with the IP ranges it stands for can save lookups, though you then have to keep those ranges up to date yourself.

Can I have two SPF records?

No. A domain must have exactly one TXT record that starts with v=spf1. With two, the result is permerror. Merge them into one.

Does SPF permerror send my emails to spam?

It can. Receivers treat a permerror like a failed SPF check. If your email also lacks a DKIM signature on your domain, it fails DMARC, and that is a common reason for spam placement.

Use these tools

Related guides