Emailgers

Common failure · updated 2026-09-03

SPF PermError: too many DNS lookups

SPF allows at most 10 DNS-querying mechanisms per evaluation, counted across nested includes. Exceeding it returns PermError, which receivers treat as no SPF result at all.

What counts as a lookup

RFC 7208 limits the mechanisms that cause DNS queries to 10 per SPF check. The counted mechanisms are include, a, mx, ptr and exists, plus the redirect modifier. The ip4, ip6 and all mechanisms do not count.

The count is cumulative across nesting. If your record includes a provider, and that provider's record includes three more, all of those count against your limit. You cannot see the total from your own record alone.

Void lookups

The same RFC limits void lookups to 2. A void lookup is a query that returns no records or NXDOMAIN, for example an include pointing at a domain with no SPF record. More than two void lookups also produce PermError.

Why PermError matters

A PermError means the receiver could not evaluate your record. Most receivers treat it as no SPF result, so SPF cannot contribute to DMARC. If your mail also lacks aligned DKIM, DMARC fails and your policy is applied to your own mail.

How to reduce the count

Start by removing includes for services you no longer use. Each provider's include often costs two to four lookups, so removing one dead include can fix the problem.

Replace a and mx mechanisms with ip4 or ip6 where the addresses are stable. Move high-volume or third-party senders to subdomains with their own SPF records, so each record stays small.

Flattening (replacing includes with the IP addresses they currently resolve to) works but breaks silently when the provider changes addresses. If you flatten, do it with a tool that re-checks regularly, and keep the primary mailbox provider as an include.

  1. List every service that sends mail as your domain.
  2. Remove includes for services that no longer send.
  3. Move newsletters and transactional senders to subdomains.
  4. Replace a and mx with ip4 or ip6 where practical.
  5. Re-run the audit and confirm the lookup count is 10 or fewer, ideally with headroom.

Sources