MailSpecto
SPF, DKIM and DMARC 3 min read

SPF PermError "too many DNS lookups" – how to stay under the 10-lookup limit

Every new sending tool adds another "include" to your SPF record. At some point the record goes over the limit of 10 DNS lookups and stops working for all senders at once. We show how to count the lookups and how to get back under the limit safely.

MailSpecto Engineering Team

Mail infrastructure and deliverability

SPF record example.com DNS lookups include: CRM 3 include: newsletter 3 include: helpdesk 2 include: shop 2 mx 1 total: 11 / 10 permerror SPF does not work

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.com

2. What counts towards the limit?

Record elementDNS lookup?
include:yes, plus every lookup inside the provider's record
a, mxyes
exists:, redirect=yes
ptryes (and you should not use it)
ip4:, ip6:, allno

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.example

Count 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

  1. 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.
  2. **Replace a and mx with ip4:.** If mx in SPF points to your own server with a fixed address, write that address directly.
  3. Move marketing mail to a subdomain. For example news.example.com gets 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.
  4. Remove duplicates. The same provider listed twice (for example its old and new record name) counts twice.
  5. 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.

  1. Count lookups in the whole include tree, not just in your own record.
  2. Remove senders you no longer use.
  3. Move marketing mail to a subdomain with its own SPF.
  4. Make sure every system signs mail with DKIM.
  5. 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.

Try MailSpecto

MailSpecto Engineering Team

We build tools for email address verification, deliverability monitoring and mail infrastructure security diagnostics for companies in Poland and Europe.

Related articles

SPF, DKIM and DMARC

DMARC reports – how to read them and move from p=none to p=reject

How to read DMARC aggregate reports (rua) and move step by step from p=none to p=quarantine and p=reject.

Read article →
SPF, DKIM and DMARC

Multiple SPF or DMARC records on one domain – why it breaks and how to merge them

Why two SPF records or two DMARC records break email authentication, how to merge them, and how to list several DMARC report addresses in one record.

Read article →
SPF, DKIM and DMARC

No DMARC record found – what a missing DMARC record means and how to add one

What "No DMARC record found" means, exactly where to add the _dmarc record, a safe starter record, and the most common DNS panel mistakes.

Read article →