SPF Flattener
AvailableFollow every include, redirect, a and mx of an SPF record, count DNS and void lookups against the RFC 7208 limits, and generate a flattened record that keeps the original evaluation order and qualifiers — with a clear note wherever exact equivalence is not possible.
Flatten an SPF record
Resolving SPF records, includes, A/AAAA and MX…
SPF overview
Flattened SPF record
Original vs flattened
SPF lookup tree
Lookup counts are the worst case — every DNS-querying term evaluated in order. A message that matches an earlier term needs fewer lookups. “Σ” shows the running total in evaluation order; terms after the 10th lookup would return PermError if evaluation reaches them.
Resolved IP inventory
Findings and recommendations
Alternatives to flattening
- Remove includes for services you no longer use.
- Remove DNS-querying mechanisms you do not need (a, mx, ptr).
- Use ip4/ip6 directly for your own stable sending servers.
- Send bulk or marketing mail from a separate subdomain with its own SPF record. This gives that mail stream its own lookup budget — it does not reduce the lookups of the main record by moving its parts to other DNS names.
- Review whether every third-party service still needs to send as this domain.
- Ask the provider whether it offers an SPF record with fewer lookups.
- Consider an SPF management service when provider addresses change often.
SPF macros are not a general way around the lookup limit: they still cost lookups and depend on the provider’s DNS setup.
How it works
The NetTools server resolves only the TXT, A, AAAA and MX records the SPF record needs, through public resolvers (1.1.1.1, 8.8.8.8), with query, depth and time limits and a TTL-based cache. Your browser then builds the lookup tree and the flattened record: each include is replaced by exactly the addresses it would pass, in the same position and with the same qualifier; terms that depend on the message (macros, ptr) are kept.
Inspect SPF on the command line
# The SPF record of a domain dig TXT example.com +short # A provider's SPF record (follow each include by hand) dig TXT _spf.google.com +short # Addresses behind a / mx mechanisms dig A mail.example.com +short dig AAAA mail.example.com +short dig MX example.com +short # Follow the delegation from the root (where the answer comes from) dig TXT example.com +trace
Each command shows one record. Counting the lookup budget means following every include and redirect recursively and adding up include, a, mx, ptr, exists and redirect — which is what this tool does. dig is in the dnsutils / bind-utils package; on Windows use WSL or Resolve-DnsName -Type TXT example.com.
Safeguards & responsible use
- Only public domain names are accepted; internal names (.local, .internal, …) are rejected.
- Queries go to public resolvers, never to internal DNS.
- Per-client rate limiting and query timeouts.
- Only TXT, A, AAAA and MX queries for names that appear in the SPF records; at most 150 queries and 20 seconds per analysis.
- The tool never publishes or changes DNS records.
Learn more
What is SPF Flattener?How it works, how to read the results, troubleshooting and FAQs. Complete guide →Frequently asked questions
Is a flattened SPF record equivalent to the original?
For every address that the analysis could resolve statically, yes: includes are replaced by exactly the addresses they would pass, in the same order and with the same qualifier. Terms that depend on the message (macros, ptr) are kept, and the tool lists every remaining difference.
Why does a flattened record need maintenance?
It contains a snapshot of your providers’ IP addresses. When a provider changes its sending infrastructure, the flattened record becomes outdated and legitimate mail can fail SPF. Re-run the flattener regularly.
Does the tool change my DNS?
No. It reads DNS and shows a proposed record; you decide whether to publish it.