Guides · Email security · Updated 2026-12-04
Fix “SPF: too many DNS lookups” (the 10-lookup limit)
SPF allows at most 10 DNS lookups. Above that, receivers return a permanent error (PermError) and treat SPF as failed, so DMARC can fail and your email lands in spam or is rejected. It happens quietly as you add tools such as a CRM, newsletter service or helpdesk.
What counts as a lookup
Each include:, a, mx, ptr, exists and redirect= costs one lookup, and the includes inside an include count too. ip4: and ip6: cost nothing. A single include such as a large email provider can use three or four lookups on its own.
1. Count your lookups
Run our free SPF checker. It follows every nested include and shows the total. If it says more than 10, continue below.
2. Remove services you no longer use
Old includes from a past newsletter tool, a former email host or a test are the most common cause. Ask: does this service still send email as our domain? If not, delete its include.
3. Replace a and mx with ip4 / ip6
If your SPF has a or mx only to cover your own mail server, replace them with that server's fixed IP addresses (ip4:203.0.113.10). That saves one lookup each. Only do this for addresses you control and that do not change.
4. Move bulk senders to a subdomain
Marketing and transactional platforms can usually send from a subdomain such as news.example.com or mail.example.com. Give that subdomain its own SPF record with the platform's include, and remove it from the main record. DMARC still protects the subdomain if your policy covers it (sp= or inherited).
5. Be careful with “SPF flattening”
Flattening replaces includes with the IP addresses they currently contain. It works, but providers change their IP ranges without notice, and a stale flattened record silently breaks delivery. Only use flattening through a service that updates it automatically.
6. Keep exactly one SPF record
Two TXT records starting with v=spf1 is also a PermError. Merge them into one.
v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 -all
Questions
- Do void lookups matter too?
- Yes. RFC 7208 also limits lookups that return no answer (void lookups) to two. Remove includes pointing at domains that no longer publish SPF.
- Is ~all or -all better?
- Both are fine once you also have a DMARC policy. Never use +all, which allows anyone.
General technical information, not legal advice or a security audit. Record values shown are examples: use the exact values from your own email provider.