Flatten an SPF record

Advanced settings

Used instead of the published record. Relative terms (a, mx without a domain) use the domain above.

Flattening
Output

DNS queries are made by the NetTools server through public resolvers (1.1.1.1, 8.8.8.8) — only TXT, A, AAAA and MX records for names in the SPF records. The tree and the flattened record are built in your browser. Nothing is published.

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.

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.