SPF DNS Lookup Limits: Counting Nested Includes and PermErrorSPF DNS Lookup Limits: Counting Nested Includes and PermError
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
SPF "too many DNS lookups" (PermError): how to count them, and why it only breaks for some of your senders.
RFC 7208 sets the limit at 10. What counts: • include, a, mx, ptr, exists and redirect: 1 lookup each, including the ones nested inside your providers' includes. • ip4, ip6 and all: free. Go past 10 and the receiver must return permerror.
Why it's easy to miss The record is still valid syntax, so a checker that only reads your top-level record says it's fine. And mechanisms are evaluated left to right, stopping at the first match: a server matched early passes before an 11th lookup is ever needed. The one that fails is usually the provider listed last, often the one you just added.
A real example, from a run of my email-auth-checker this morning: github.com uses exactly 10 of 10. Eight includes on the record itself, one more inside SendGrid's include, one exists inside Salesforce's. One more lookup anywhere in that tree and the last senders stop passing SPF.
How to get back under 10 • Remove includes for tools you no longer send from. An include pointing to a domain with no SPF record is a permanent error for every message. • Move senders that don't need your root domain to a subdomain (news.yourdomain.com), with its own SPF record and its own 10 lookups. • Replace an include with the provider's ip4/ip6 ranges only if they publish fixed ranges, and recheck them, because they change. • Recount after every new tool. Nested records belong to your providers and change without you touching anything.
How many includes are on your SPF record, and are you still sending from all of them?
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started