What is SPF Flattening?
SPF flattening is the process of resolving all nested include mechanisms in an SPF record into their final IP addresses. Instead of relying on multiple DNS lookups at email delivery time, a flattened record contains all authorized IPs directly, reducing lookup count and improving email deliverability.
Why Flatten Your SPF Record?
The SPF specification limits each record to a maximum of 10 DNS lookups. Every "include:", "a:", "mx:", "redirect=", and "exists:" mechanism triggers a lookup. When your organization uses multiple email services (Google Workspace, Microsoft 365, Mailchimp, SendGrid, etc.), these includes quickly stack up and can exceed the limit. When that happens, receiving mail servers may return a "permerror" and reject or spam-filter your legitimate emails. Flattening resolves all nested lookups into direct ip4 and ip6 entries, eliminating the lookup overhead entirely.
How Does Recursive SPF Resolution Work?
Our tool starts with your domain's root SPF record and follows every include and redirect chain recursively. For each included domain, it fetches the SPF record, extracts IPs, resolves a and mx mechanisms to their actual IP addresses, and follows any further includes. The result is a complete tree showing exactly which IPs are authorized at each level, plus a flat list of all unique IPs that can send email on behalf of your domain.
Benefits of SPF Flattening
- Stay under the 10 DNS lookup limit to avoid permerror failures
- Improve email deliverability by ensuring SPF always validates correctly
- Get full visibility into every IP authorized to send on your behalf
- Identify unknown or unauthorized sending services in your SPF chain