🧮 SPF Flattener & Lookup Counter

Count the DNS lookups your SPF record consumes against the hard limit of 10, see exactly what each one costs, and flatten includes to IP addresses to get back under the limit.

Enter a domain to analyze its published SPF record

Why SPF Has a 10-Lookup Limit

To stop SPF from being abused for denial-of-service, RFC 7208 caps the number of DNS-querying mechanisms a record may use at 10. Every include:, a, mx, ptr, exists:, and redirect= counts as one — and nested includes count too, so a handful of third-party senders can quietly push you over. Exceed 10 and receivers return a PermError, which means they stop trusting your record and your legitimate mail can start failing SPF.

What Flattening Does (and Its Trade-off)

Flattening replaces lookup-consuming mechanisms (include, a, mx) with the IP addresses they currently resolve to (ip4:/ip6:), which cost zero lookups. The result is one record that never trips the limit.

The catch: those IPs are a snapshot. When a provider rotates its sending IPs, a flattened record goes stale and mail fails until you regenerate it. So the better first move is usually to remove senders you no longer use; flatten only when you truly can't get under 10 any other way — and re-flatten on a schedule.

Building a record from scratch instead? Use the SPF generator, then validate it.

Frequently Asked Questions

How do I count the DNS lookups in my SPF record?

Enter your domain above. This tool fetches your published SPF record, expands every include recursively, and counts each lookup-consuming mechanism against the limit of 10 — showing exactly which ones cost a lookup.

What causes an SPF "too many DNS lookups" / PermError?

More than 10 DNS-querying mechanisms. Because nested includes count too, adding a few third-party senders (each with its own includes) is the usual culprit. Reduce includes or flatten to IPs to get back under the limit.

What is SPF flattening?

Flattening resolves your include, a, and mx mechanisms down to the IP addresses they point to, published as ip4:/ip6:. Those cost no lookups, so the record stays under the limit — at the cost of needing maintenance when providers change IPs.

Is SPF flattening safe?

It works, but it shifts maintenance onto you: a flattened record must be regenerated whenever a provider changes its sending IPs, or mail silently starts failing SPF. Prefer removing unused senders first; flatten only as a last resort and re-check regularly.

Is this SPF flattener free?

Yes — count lookups and generate a flattened record for any domain, free and with no account.