1. What does the error mean?
When the receiving server checks SPF, it sometimes has to make extra DNS queries: fetch a provider's SPF record from include:, or resolve the addresses behind a or mx. The SPF specification (RFC 7208) limits these to 10. When a record needs more, the result is not "fail" but permerror: a permanent error meaning SPF for your domain does not work at all.
In the headers of a rejected or suspicious message you will see something like:
Received-SPF: permerror (too many DNS lookups) client-ip=203.0.113.25
Authentication-Results: mx.google.com; spf=permerror smtp.mailfrom=example.com2. What counts towards the limit?
| Record element | DNS lookup? |
|---|---|
include: | yes, plus every lookup inside the provider's record |
a, mx | yes |
exists:, redirect= | yes |
ptr | yes (and you should not use it) |
ip4:, ip6:, all | no |
The main trap: includes count recursively. One provider's include: can contain further includes, so a single line in your record can use up several lookups. There is a separate limit for empty answers (void lookups): more than two entries that return nothing also end in permerror.
3. How to count the lookups
Fetch your record and every record an include points to:
dig +short TXT example.com | grep spf1
dig +short TXT _spf.provider.exampleCount every include, a, mx, exists and redirect at every level. It is easy to get wrong by hand, so the domain audit in the MailSpecto panel counts it for you: it shows the number of lookups, warns from 8 of 10, and points to the include that uses the most.
4. Five ways to get under the limit
- Remove senders you no longer use. An old newsletter tool nobody has sent from in a year still uses lookups. This is the most common and the safest fix.
- **Replace
aandmxwithip4:.** Ifmxin SPF points to your own server with a fixed address, write that address directly. - Move marketing mail to a subdomain. For example
news.example.comgets its own SPF record with the newsletter provider's single include, and the main domain's record stays short. DMARC in relaxed mode (aspf=r) accepts the subdomain. - Remove duplicates. The same provider listed twice (for example its old and new record name) counts twice.
- Flattening only with automation. Replacing includes with a list of IP addresses works until the provider changes its addresses. Do it only with a tool that updates the record automatically; an SPF record flattened by hand starts rejecting real mail after a few months.
Do not add a second SPF record
Splitting one long record into two v=spf1 records does not get around the limit. Two SPF records are a separate permerror (see Multiple SPF or DMARC records on one domain).
5. Does permerror mean mail will not arrive?
Not always. DMARC lets a message through if DKIM passes with a domain aligned to the sender. That is why many companies do not notice a broken SPF for years. The problem shows up when one of the systems does not sign with DKIM and the DMARC policy is quarantine or reject: its mail then goes to spam or is rejected. More on how the protocols depend on each other: SPF, DKIM and DMARC – step-by-step setup.
- Count lookups in the whole include tree, not just in your own record.
- Remove senders you no longer use.
- Move marketing mail to a subdomain with its own SPF.
- Make sure every system signs mail with DKIM.
- Check the record again after each change: the limit is 10, a safe margin is 8.
Keep your contact list clean
Verify email addresses before you send, and explore our upcoming SPF/DKIM/DMARC diagnostics module.
MailSpecto Engineering Team
We build tools for email address verification, deliverability monitoring and mail infrastructure security diagnostics for companies in Poland and Europe.