SPF flattener
Replaces the includes in your SPF record with the IP ranges behind them, so a record over 10 lookups passes again.
What the SPF flattener does
Flattening replaces includes with the IP ranges they resolve to. The flattener walks your record, resolves every include, a and mx term down to ip4 and ip6 entries, and writes a record that needs few or no DNS lookups when a receiver evaluates it.
Use it when a record is over the limit of 10 lookups, or close to it, and you can't remove a sender.
The catch: a flattened record goes stale
Providers change their IP ranges without telling you. An include follows the change. A flattened copy doesn't, so the day a provider sends from a range you didn't list, that mail fails SPF.
Flatten only what you must. A common middle path keeps the includes of your main providers and flattens the smaller senders, staying at or under 10. Re-run the flattener on a schedule and whenever a provider announces new ranges.
Flattened records also get long. If the result passes 512 bytes, DNS replies may need TCP, which RFC 7208 advises against. Split the ranges across a few include records on your own subdomains, each costing one lookup.
How to read and publish the result
You get the flattened record, its lookup count and its length. Compare it with the tree from the SPF checker: every range in the tree should appear in the flat record.
Keep a copy of the original record with its includes, publish the flat one in its place, and run the SPF checker again to confirm it resolves.
Why it matters for cold email
Outbound setups pile on senders: a mailbox provider, a sequencer, a CRM, a calendar tool, a help desk. Each asks you to add an include, and one more quietly pushes the record past 10. Then every message fails SPF, including the ones from your main inboxes.
The cleaner fix is often to take senders off the sending domain. A cold email domain only needs its mailbox provider. Flatten when that isn't possible.