Email Security · Jason Osborne

SPF Too Many DNS Lookups: Fix It Without Risky Flattening

SPF Too Many DNS Lookups: Fix It Without Risky Flattening

SPF allows at most 10 DNS lookups per check. A record that needs more returns a permanent error.

What counts

  • include:, a, mx, exists and redirect= each use a lookup.
  • Lookups inside an included record count too, so one include: can use several.
  • ip4:, ip6: and all use none.
  • No more than 2 lookups may come back empty, and one mx entry must not lead to more than 10 mail servers.

How to cut them

  1. Run the SPF record checker and open the lookup tree to see which entry costs the most.
  2. Remove services you no longer use. Ask who set up each one before deleting it.
  3. Remove a and mx if those servers don’t send your email. Avoid ptr.
  4. Move bulk or marketing email to a subdomain, which gets its own SPF record and its own 10 lookups.
  5. Check whether a service needs your SPF at all. Many send with their own bounce domain and rely on DKIM for DMARC.

SPF flattening: be careful

Replacing an include: with the IP addresses behind it saves lookups, but the provider can change those addresses without telling you. Only do it if something keeps the list current.