The SPF 10-lookup limit

RFC 7208 ยง4.6.4 says receivers must abort SPF evaluation after 10 DNS lookups. The result: PermError. Your SPF record is silently ignored as if it didn't exist. Most outages here are not discovered until weeks later.

What counts as a lookup

These mechanisms each consume one lookup when receivers evaluate your record:

  • include:domain.com — one lookup, plus every lookup inside the included record (recursive).
  • a / mx — one lookup each.
  • ptr — one lookup (and ptr is deprecated; don't use it).
  • exists:domain.com — one lookup.
  • redirect=domain.com — one lookup, plus everything in the target record.

What doesn't count

  • ip4: and ip6: — zero lookups (the value is the answer).
  • all, v=spf1 — zero lookups.

What each major ESP costs you

ProviderIncludeLookups
Google Workspace / Gmail_spf.google.com1
Microsoft 365 / Outlookspf.protection.outlook.com1
SendGridsendgrid.net2
Mailchimp / Mandrillservers.mcsv.net2
Mailgunmailgun.org2
Amazon SESamazonses.com1
HubSpot_spf.hubspotemail.net1
Salesforce_spf.salesforce.com2
Klaviyo_spf.klaviyo.com1
Zoho Mailzoho.com1

Lookup counts can change when an ESP restructures their SPF macros. Run the SPF Checker for live numbers.

How to fix an over-limit record

  1. Audit. Are you including ESPs you stopped using?
  2. Consolidate. If two tools both send through SendGrid, you only need to include SendGrid once.
  3. SPF flattening (last resort). Resolve the includes once and inline the resulting ip4: entries. Cheap on lookups, but you have to re-flatten when the provider rotates IPs.
  4. Subdomain delegation. Move bulk senders to a subdomain (e.g. m.example.com) so the apex doesn't carry their SPF cost.

Check your SPF lookup count →