Skip to content

SPF record has too many DNS lookups

To check an SPF record, a receiving server has to look up every include:, a, mx, ptr, exists and redirect in it, and every one nested inside those. The SPF standard stops at 10. Your record needs more, so receiving servers give up and treat it as an error.

Why it matters

When SPF errors, your real email loses one of its two passes for DMARC. If its DKIM signature doesn’t pass either, it can go to spam or be rejected, even though you sent it.

The limit is easy to reach without noticing: each email service you add usually brings an include:, and some of those contain several more.

ip4:, ip6: and all don’t count, which is why replacing lookups with addresses is the usual fix.

How to fix it

  1. Open the SPF check in your Email Security Check report to see the lookup count and which entries cost the most.
  2. Remove services you no longer use. Old newsletter tools and past hosting providers are the usual suspects.
  3. Check each remaining service’s help pages: some only need DKIM (they send from their own domain as far as SPF is concerned) and their include: can go.
  4. Replace a or mx entries with the ip4: or ip6: addresses they point to, if those addresses rarely change.
  5. If you still need more than 10, look at an SPF flattening service (offered by some DNS and DMARC services, it keeps one record of addresses up to date), or move some sending to a subdomain with its own SPF record.

Common mistakes

  • Counting only the include: entries in your own record. The ones inside them count too.
  • Flattening by hand: copying a provider’s addresses into ip4: entries works until the provider changes them, and then your email fails without warning.
  • Adding ptr, which costs lookups and which the SPF standard says not to use.

Check your fix

Once the change is live, check again. DNS changes can take up to a few hours to show everywhere.