Guides · Updated October 28, 2026 · Not legal advice; provider rules change, so check the linked sources.

How to fix "SPF too many DNS lookups" (PermError)

SPF has a hard limit: evaluating your record may trigger no more than 10 DNS lookups (RFC 7208, section 4.6.4). Go over it and receivers return permerror, which most treat as an SPF failure. If DKIM isn't aligned either, DMARC fails too and your mail can land in spam or be rejected.

What counts toward the 10

Count your lookups

dig +short TXT yourdomain.com
dig +short TXT _spf.google.com

Start with your v=spf1 record, then look up each include: and add up the mechanisms above, nested ones included. Large providers often use several lookups each, so four or five services can push you past 10. The free scan shows your SPF record and flags common errors.

Ways to get under the limit

  1. Remove senders you no longer use. Old newsletter tools, CRMs and former hosts are the most common cause.
  2. Drop ptr. RFC 7208 says not to use it.
  3. Replace a and mx with ip4/ip6 when your own server's addresses are fixed and known, and only if that server actually sends mail.
  4. Move bulk or marketing senders to a subdomain such as news.yourdomain.com. Each subdomain has its own SPF record and its own 10-lookup budget, and DMARC's relaxed alignment still passes when the visible From uses that subdomain.
  5. Lean on DKIM for services that support it. DMARC passes if either SPF or DKIM passes and aligns. Many services send with their own bounce domain, so their include in your SPF may not help DMARC at all. Check each provider's docs before removing one.
  6. Flatten only with care. Replacing includes with the IP ranges they resolve to cuts lookups, but providers change their ranges without notice. A hand-flattened record goes stale and starts failing silently, so it needs regular re-checking.

After you change it

Not sure what's sending as you? Run the free ExclusiveTrust scan. If you'd rather not touch DNS yourself, our managed fix sorts out SPF, DKIM and DMARC for you, and Trust Monitor re-checks your records daily so a provider change doesn't quietly break them.