Topic · Authentication
SPF lookup limit
SPF evaluation can trigger a permerror when a policy exceeds its limit of ten DNS-querying mechanisms or modifiers.
How it works
include, a, mx, ptr, exists and redirect can consume the shared lookup allowance.
What can go wrong
SPF processing can return permerror if it exceeds ten DNS-querying mechanisms/modifiers; raw DNS-query volume and void lookups involve additional nuances.
What to check or do
Flatten cautiously or consolidate authorized senders and retest recursively.
Practical scenario
A published SPF TXT record appears short, but two include entries each expand into multiple nested includes. Receivers evaluate the entire lookup chain, not simply the textual count of include tokens in the root record.
Verification checklist
- Count only DNS-querying mechanisms and modifiers that are evaluated.
- Test multiple representative source IPs because evaluation follows different branches.
- Inspect redirect, exists, mx and a mechanisms as well as include.
- Remove obsolete services or use maintained optimization rather than blindly adding records.
How to investigate SPF lookup limit
- Signal to investigate
- A policy with several include directives can fail selectively as nested mechanisms consume the DNS budget.
- Evidence to collect
- Evaluate the actual path for a sender IP and count DNS-querying mechanisms, including recursion.
- Common wrong conclusion
- Ten is a processing limit, not a simple count of the words 'include' written in the top-level record.
How to interpret the evidence
The ten-lookup rule is not ten DNS packets and not a character limit. It applies to SPF mechanisms and modifiers that trigger DNS queries, with recursion, while additional constraints can apply to void lookups. A failure may show up only for specific sender IPs because another mechanism matched earlier in different evaluation paths.
What to change and how to verify it
Model at least one real IP for every sender, count lookups along each evaluated path and check DNS errors separately from permanent limit violations. Reduce obsolete includes, avoid risky static flattening, and repeat a real delivery test after changes.
dig +short TXT example.comEducational example; not validated against your live infrastructure.Put this into practice
Run a focused check, then explore protection if your domain needs it.