3,932 Australian domains analysed. Most fail basic email authentication. [2026 Report]

SPF Flattener Tool

Resolve includes and flatten your SPF record to reduce DNS lookups

SPF Record to Flatten

Enter the full SPF record starting with v=spf1.

Estimated DNS Lookups
0 / 10 max

What is SPF Flattening?

Resolves all include: statements into their underlying IP addresses, reducing DNS lookups.

Before: include:_spf.google.com
After: ip4:142.250.x.x

IP Addresses Can Change

Flattened records use static IPs. If your email providers change their IPs, you'll need to update. Consider DMARC Busta's managed SPF for automatic updates.

Want automated management?

DMARC Busta's Autopilot manages SPF, DKIM, and DMARC automatically with AI-powered decisions.

Get Started Free

What is SPF Flattening?

Resolve nested includes into IP addresses to stay under the 10-lookup limit

SPF flattening is the process of resolving include: mechanisms in your SPF record down to their underlying IP addresses. Every include:, a:, mx:, and redirect= mechanism in an SPF record triggers a DNS lookup. The SPF specification (RFC 7208) imposes a strict limit of 10 DNS lookups per SPF evaluation. If your record exceeds this limit, receiving mail servers return a permanent error (permerror) and your emails may fail authentication.

For organisations using multiple email services — such as Google Workspace, Microsoft 365, a marketing platform, and a transactional email provider — it is common to hit or exceed the 10-lookup limit. Each service typically requires its own include: directive, and those includes often contain nested includes of their own, quickly consuming your lookup budget.

Flattening replaces these nested include chains with the actual IP addresses (using ip4: and ip6: mechanisms), which do not count towards the lookup limit. Use our SPF Checker to see how many lookups your current record uses, or build a new record with our SPF Builder.

Before Flattening (7+ lookups)
v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:sendgrid.net ~all
After Flattening (0 lookups)
v=spf1 ip4:142.250.0.0/16 ip4:52.100.0.0/14 ip4:167.89.0.0/17 ~all

How Flattening Works

1
Parse all include: mechanisms
2
Recursively resolve to final IP addresses
3
Replace includes with ip4:/ip6: entries
4
DNS lookups drop to zero

How SPF Flattening Works

Understanding the flattening process and what changes in your SPF record

Resolve Includes to IPs

The flattening process performs recursive DNS lookups on each include: mechanism, following the chain until it reaches the final IP addresses. These IPs are then written directly into your SPF record as ip4: and ip6: entries.

Lookup Count Reduction

Since ip4: and ip6: mechanisms require no DNS lookups, flattening can reduce your lookup count from well over 10 down to zero. This gives you room to add additional services without exceeding the limit.

Partial Flattening

You do not need to flatten every include. A practical approach is to keep includes for services that change IPs frequently and only flatten those that push you over the 10-lookup limit. This balance reduces risk while solving the lookup problem.

Validate Before Publishing

Always validate your flattened record with an SPF Checker before publishing to DNS. Confirm it is syntactically valid, within the 255-character TXT record limit, and that all legitimate sending IPs are included.

Risks and Best Practices

Important considerations to keep your flattened SPF record working correctly

IP Addresses Change

The most significant risk of SPF flattening is that email service providers regularly update their sending IP addresses. When you flatten an include into static IPs, you lose the automatic updates that the include mechanism provides. If a provider adds new IPs or retires old ones, your flattened record becomes stale and emails may fail SPF checks.

Regular Re-flattening Required

Fix: Re-flatten your SPF record at least weekly. Providers like Google and Microsoft can change their IP ranges without notice. Automated monitoring tools can alert you when underlying IPs change, ensuring your record stays current.

Record Length Limits

Fix: Flattened records can exceed the 255-character DNS TXT record limit. Ensure your DNS provider supports multi-string TXT records, or use partial flattening to keep the record manageable. Always validate with an SPF Checker before publishing.

Automate this: DMARC Busta automatically manages your SPF record, keeping it optimised and up to date as provider IPs change. No more manual re-flattening.

Frequently Asked Questions

What is SPF flattening?
SPF flattening is the process of converting include: mechanisms in your SPF record into their resolved ip4: and ip6: addresses. This reduces the number of DNS lookups required to evaluate your SPF record, helping you stay under the 10-lookup limit imposed by the SPF specification.
Is SPF flattening safe?
Yes, SPF flattening is safe when properly maintained. The primary risk is that email providers change their sending IP addresses over time. If you flatten your record and do not update it regularly, new IPs will not be authorised and legitimate emails may fail SPF checks. Re-flatten at least weekly to keep your record current.
How often should I re-flatten?
At a minimum, re-flatten your SPF record weekly. Email service providers such as Google, Microsoft, and Amazon SES can change their sending IP ranges without prior notice. Automated SPF management solutions can monitor for changes and update your record in real time, eliminating the need for manual re-flattening.
What happens if I exceed 10 DNS lookups?
When an SPF record exceeds 10 DNS lookups, the evaluating mail server returns a permanent error (permerror). Most receiving servers treat this as an SPF failure, which means your emails will not pass SPF authentication. This can lead to emails being quarantined, rejected, or flagged as spam, particularly if you also have a DMARC policy in place.

Automate Your SPF Management

Stop manually flattening and re-flattening. DMARC Busta keeps your SPF record optimised automatically, so you never exceed the 10-lookup limit.

Get Started Free