SPF Too Many DNS Lookups: What It Means and How to Fix It
Last updated 2026-05-29 — By The InboxGreen Team
"SPF too many DNS lookups" means your SPF record requires more than 10 DNS queries to fully resolve. RFC 7208 sets a hard limit of 10 DNS-querying mechanisms (include, a, mx, ptr, exists). When that limit is exceeded, the result is a PermError and SPF fails entirely, even if every sender listed is legitimate. The fix is to reduce lookups by replacing include: mechanisms with direct IP addresses.
What it means
Every time your SPF record contains an <code>include:</code>, <code>a</code>, <code>mx</code>, or <code>redirect=</code> mechanism, the receiving server must make an additional DNS query to resolve it. Each of those nested records may itself contain further includes, and each counts toward the 10-lookup limit. Large SaaS stacks (Google Workspace + Mailchimp + HubSpot + SendGrid) can easily exceed 10 lookups.
Why it matters
A PermError caused by too many lookups has the same effect as no SPF record at all. Receivers treat it as an SPF failure, which can silently break deliverability at scale, especially as you add more sending tools over time. The limit was set in the original SPF spec to prevent DNS abuse and it is enforced by all major providers.
How to count your current DNS lookups
v=spf1 ip4:192.0.2.1 ip4:198.51.100.0/24 include:sendgrid.net ~all
ip4: and ip6: mechanisms do not count as lookups since they are direct IP references. Replacing include: entries with their underlying IP ranges is the most reliable way to reduce lookup count. Use InboxGreen or MXToolbox to count current lookups.
How to fix it
Any DNS provider
- Run your domain through the InboxGreen checker to confirm you have a lookup overflow.
- List every sending service in your current SPF record.
- For each
include:, look up what IP ranges it resolves to (check the provider's documentation). - Replace
include:mechanisms with directip4:orip6:entries where possible. - Keep
include:only for services that rotate IPs frequently (like Google Workspace). - Re-run the checker to confirm the lookup count is now under 10.
Alternative: SPF flattening service
- Services like AutoSPF or dmarcian's SPF Surveyor can automatically flatten your SPF record.
- They resolve all includes to their current IPs and generate a single flat record.
- Note: flattened records need periodic updates as providers change their IP ranges.
How to verify the fix
- After updating your SPF record, wait a few minutes for propagation.
- Run your domain through the InboxGreen free checker.
- SPF should now show PASS instead of a PermError or warning about lookup count.
Check your fix right now
Run your domain through InboxGreen's free checker to confirm the issue is resolved.
Common mistakes
- Counting only the top-level includes. Nested includes inside those also count toward the limit.
- Flattening IPs without a process to keep them updated. Providers change IP ranges and your record becomes stale.
- Removing legitimate senders when flattening. Check all your sending platforms before removing any include.
- Confusing the 10-lookup limit with the 255-character string limit. These are two separate SPF constraints.
Frequently asked questions
Related fix guides
- SPF Record Not Found: What It Means and How to Fix It
- Multiple SPF Records: Why It Breaks Email and How to Fix It