Skip to main content
DNSMedium PriorityPro

SPF Lookup Limit

Updated November 2026·SecScanner Team

SPF records are limited to 10 DNS lookups per RFC 7208. Exceeding this limit causes SPF validation failures and email delivery issues.

Results in 1–3 minutes · Free · No signup required

Why It Matters

When SPF exceeds 10 lookups, receiving mail servers return PermError, causing legitimate emails to fail SPF checks. This can result in emails being rejected or marked as spam.

How We Check

We recursively resolve your SPF record, counting DNS lookups from include, a, mx, ptr, exists, and redirect mechanisms to verify compliance with the 10-lookup limit.

Good vs Bad Values

Good and bad values for SPF Lookup Limit
ValueVerdictWhy
v=spf1 ip4:203.0.113.0/24 include:_spf.google.com -all (2 lookups)Goodip4 and the final all cost nothing; only the include is a DNS lookup. Plenty of headroom.
v=spf1 include:_spf.google.com include:mailgun.org include:sendgrid.net ~all (about 6 to 8 lookups)WeakThe check passes up to 10, but at 8 or more it advises you to optimise. Providers add nested includes without notice.
v=spf1 a mx include:spf.protection.outlook.com ~allGoodEach of a, mx and include is one lookup, plus whatever the included record uses. Count the whole tree, not only the top line.
11 or more DNS-querying terms in totalBadRFC 7208 stops evaluation at 10 and returns permerror. Receivers may then treat SPF as failed or ignore it.
v=spf1 ptr ...BadThe ptr mechanism is slow, unreliable and discouraged by RFC 7208. It also uses up the lookup budget.
Two TXT records that both start with v=spf1BadOnly one SPF record is allowed per name. Two give permerror regardless of the lookup count.
No SPF recordGoodThis check only applies when SPF exists, so a missing record passes here. The Email Domain Security check covers the missing record.

How to Fix

Flatten SPF includes by replacing them with direct IP ranges. Remove unused mechanisms. Consider using SPF macro syntax. Use tools like dmarcian or MXToolbox to monitor lookup count.

Audit first — see how many lookups you actually use and which includes drive them:

dig +short TXT example.com | grep spf1
dig +short TXT _spf.google.com
# repeat for every include: and redirect= target, adding up each a, mx, include, exists, ptr, redirect

Remove senders you no longer use. Delete the include of any service that no longer sends mail for the domain before looking at anything cleverer.

Move bulk senders to a subdomain. Give each sender its own subdomain with its own SPF record, so the budget is not shared:

example.com.        3600 IN TXT "v=spf1 include:_spf.google.com -all"
news.example.com.   3600 IN TXT "v=spf1 include:mailgun.org -all"
help.example.com.   3600 IN TXT "v=spf1 include:mail.zendesk.com -all"

Replace includes with literal ranges when the service's addresses are stable, using ip4: and ip6:, which do not count. Cloudflare / Route 53: enter the whole value as one TXT record, in quotes; if it passes 255 characters, split it inside the quotes into adjacent quoted strings.

Re-test after every change, and add a calendar reminder to look again when you add a new sending service.

Common Mistakes

  • Counting only the top record. The limit applies to the whole evaluation, including every nested `include:` and `redirect=`.
  • Adding an include for every SaaS tool that ever sent a message. Marketing, CRM, ticketing and invoicing tools each add one or several lookups, and nobody removes the old ones.
  • Flattening SPF once by hand. Providers change their IP ranges, so a hard-coded list goes stale and starts rejecting real mail. Use a service that keeps it updated or avoid flattening.
  • Using `mx` and `a` when the sending IP is already in an include. Each term costs a lookup for no gain.
  • Forgetting the void lookup limit. RFC 7208 also stops after two lookups that return nothing, which a mistyped include domain can cause even with a short record.
  • Hitting the 255-character string limit. A long record has to be split into several quoted strings inside one TXT record, not into several TXT records.

Frequently Asked Questions

What is SPF Lookup Limit?

SPF records are limited to 10 DNS lookups per RFC 7208. Exceeding this limit causes SPF validation failures and email delivery issues.

Why does SPF Lookup Limit matter for website security?

When SPF exceeds 10 lookups, receiving mail servers return PermError, causing legitimate emails to fail SPF checks. This can result in emails being rejected or marked as spam.

How do I fix SPF Lookup Limit issues?

Flatten SPF includes by replacing them with direct IP ranges. Remove unused mechanisms. Consider using SPF macro syntax. Use tools like dmarcian or MXToolbox to monitor lookup count.

Related Security Checks

Check Your Website Now

Run a free security scan to check for SPF Lookup Limit issues and 61 other security checks.

Scan Your Website Free