SPF flattening tool and lookup counter

See what every include in your SPF record costs against the limit of 10 DNS lookups, fix what is cheap first, then flatten only what you must. Free, no signup.

Reads public DNS only: nothing is changed and no email is sent.

How the count works

Ten lookups, counted through every include.

What counts
Each include, a, mx, ptr, exists and redirect costs one lookup, and so does every one inside the records you include.
What does not
ip4 and ip6 ranges and all cost nothing, which is why flattening an include into its ranges lowers the count.
Void lookups
A lookup that finds nothing, such as an include of a domain with no SPF record. Receivers may fail SPF after two.
Stale copies
A flattened include no longer follows its service. When flattening is worth it, and other ways to get under 10.

Questions, answered

Before you flatten.

What does flattening an SPF record do?

It replaces an include with the IP ranges that include lists today, so receivers no longer look it up. The record then costs fewer of its 10 DNS lookups, but it is a copy: when the service changes its servers, your record does not follow.

Should I flatten my whole record?

Only as much as you must. Remove includes for services you no longer use and duplicates first; then flatten the fewest, most expensive includes that bring you under 10. Every include you keep still updates itself.

Why can some includes not be flattened?

An include that uses a, mx, exists, ptr or a macro, or that could not be looked up, gives an answer that depends on DNS when the message arrives. Copying it would be wrong the moment that answer changes, so the tool keeps it as an include.

How do I keep a flattened record current?

Re-check it whenever a service you include announces new servers, and at least monthly. Monitoring re-checks your SPF record on a schedule and alerts you when it changes.