Suped

What are the best practices for using SPF flatteners and managing SPF records?

Matthew Whittaker profile picture
Matthew Whittaker
Co-founder & CTO, Suped
Published 31 Jul 2025
Updated 22 May 2026
9 min read
Summarize with
Editorial thumbnail about SPF flatteners and SPF record management.
The best practice is to use an SPF flattener only when it is managed, refreshed automatically, and monitored. A one-time flattened TXT record is an interim fix, not a durable SPF strategy. The durable strategy is to remove unused senders, move unrelated mail streams to subdomains, keep the root domain simple, and use dynamic SPF or hosted SPF when lookup limits still block you.
I treat SPF flattening as a pressure valve for the 10 DNS lookup limit. It works, but only if the system keeps provider IPs current and alerts you when the record stops matching real mail. Suped's Hosted SPF workflow fits that model because it sits next to DMARC, DKIM, blocklist (blacklist) monitoring, and issue detection instead of leaving SPF as a static DNS chore.

When an SPF flattener is the right move

Use an SPF flattener when a domain has a valid need to authorize multiple senders and those senders push the SPF record close to or beyond 10 DNS lookups. The most common case is a main domain that has accumulated mail platforms over several years: corporate mail, ticketing systems, CRM mail, billing mail, webinar mail, and outbound sales tools.
The mistake is treating flattening as the first answer. Before I flatten anything, I want to know which domain each sender uses in the SMTP return path. SPF checks the RFC5321.MailFrom domain, often called the envelope sender or bounce domain. For bulk mail, that domain is often a vendor-managed bounce domain or a branded subdomain, not the visible From domain.
  1. Use flattening tactically: Choose it when cleanup takes time and SPF failures already affect real mail.
  2. Prefer sender cleanup: Remove includes for platforms that do not send with your return-path domain.
  3. Separate mail streams: Move marketing, billing, alerts, and sales mail to purpose-built subdomains.
  4. Keep ownership clear: Document every SPF mechanism with the sender, owner, and business purpose.
SPF lookup budget
Use lookup count as an operating signal, not just a pass or fail result.
Healthy
0-6
Room for routine sender changes.
Tight
7-9
Requires review before adding senders.
Limit
10
Any nested include can break SPF.
Broken
11+
SPF returns permerror for receivers that enforce the limit.
Flattening adds operational risk when it turns several provider-maintained SPF includes into one static IP list. Mail providers change IP ranges. If the flattened record does not refresh, valid mail can fail SPF without a DNS syntax problem.

What a safe SPF flattener must do

A safe flattener does more than expand includes into IP addresses. It rechecks upstream SPF records, detects changes, publishes an updated hosted policy, and gives you enough logging to know what changed. That is the difference between SPF flattening as a managed process and SPF flattening as a risky copy-paste operation.
One-time flattening
  1. Best for emergencies: It can restore SPF validity while you clean up senders.
  2. Weak refresh model: Someone must rerun it when upstream sender records change.
  3. Higher drift risk: DNS can look valid while real sender coverage has aged out.
Dynamic hosted SPF
  1. Best for operations: It refreshes provider data without constant DNS edits.
  2. Better change control: The platform can show what changed and why.
  3. Lower DNS churn: Teams can manage senders without editing the root TXT record.
When I evaluate an SPF flattener, I ask practical questions: how often does it refresh, what happens if an upstream include fails, whether it keeps the published record under DNS size limits, and whether it alerts before SPF failures spread. A free tool that returns a static list can be useful for diagnosis, but I do not want that static list running a production domain without a refresh plan.
Cloudflare DNS screen showing an SPF TXT record being edited.
Cloudflare DNS screen showing an SPF TXT record being edited.

Clean the SPF record before flattening

Most overstuffed SPF records are not caused by a single unavoidable sender. They come from years of adding includes to the wrong domain. I start by matching each mail stream to the domain used in the return path. If a vendor sends with its own bounce domain, adding that vendor to your root SPF record does not help SPF for that mail.
Crowded root SPF recorddns
v=spf1 include:_spf.mail.example include:spf.crm.example -all
Cleaner SPF patterndns
example.com. TXT "v=spf1 include:_spf.corp.example -all" bounce.example.com. TXT "v=spf1 include:spf.sender.example -all"
That second pattern keeps the root domain focused on corporate mail and puts bulk sender authorization on the bounce subdomain that actually needs SPF. It also makes DMARC easier to reason about because each sending service has a clear identity boundary.

Mechanism

Use

Risk

include
Vendor SPF
Nested lookups
ip4
Stable senders
Manual updates
a
Rare cases
Extra lookups
mx
Inbound hosts
Often wrong
redirect
Full delegation
Less local control
Use compact mechanisms and avoid lookup-heavy shortcuts where they add no value.
  1. Audit first: List every sender, return-path domain, DKIM domain, and business owner.
  2. Remove dead includes: Check DMARC reports for sources that have not sent in the last 30 to 90 days.
  3. Avoid root bloat: Do not authorize every vendor on the organizational domain by default.
  4. Use IPs carefully: Static IP mechanisms work well only when ownership and update paths are clear.
If your record has already crossed the limit, use a focused lookup fix before you publish a bigger workaround. If your record depends on static sender ranges, review IP address guidance so you do not trade lookup risk for stale IP risk.

How to manage SPF after rollout

After rollout, SPF management becomes a change-control problem. Someone needs to know when a new sender is added, when a sender stops sending, and when a provider changes its own SPF. The cleanest operating model is to keep one published SPF entry for the domain and manage approved senders inside a hosted policy.
Hosted SPF include patterndns
example.com. TXT "v=spf1 include:spf.hosted.example -all"
Hosted SPF and SPF flattening drawer showing desired SPF record, hosted include, and DNS setup
Hosted SPF and SPF flattening drawer showing desired SPF record, hosted include, and DNS setup
Suped is the stronger practical choice for most teams when SPF work needs to connect to DMARC reporting, DKIM checks, and deliverability monitoring. Suped's Hosted SPF lets teams manage senders without repeated DNS access, flatten records automatically, stay under SPF lookup limits, and see fix steps when a source starts failing.
I also want alerts. A quiet SPF failure is dangerous because the TXT record still exists and a basic DNS check can look fine. The useful signal is whether real messages from approved sources pass SPF, pass DKIM, and match the visible From domain well enough for DMARC to pass.

SPF checker

Find SPF syntax issues, lookup limits, and weak records.

?/16tests passed
For a quick DNS-level validation, use the SPF checker after each change. Then validate with real message data because SPF syntax is only one part of the authentication outcome.

Validation and monitoring checks

The right validation sequence is DNS check, authentication check, then production monitoring. DNS confirms the policy is valid. Message testing confirms a real sender passes. DMARC reporting confirms the change works across receivers and mail streams over time.
Flowchart showing SPF cleanup, hosted SPF, validation, and monitoring.
Flowchart showing SPF cleanup, hosted SPF, validation, and monitoring.
  1. Check lookup count: Confirm the record stays below 10 DNS lookups after nested includes resolve.
  2. Check TXT size: Avoid oversized answers that create DNS fragmentation or receiver parsing issues.
  3. Check real messages: Send from each approved platform and inspect SPF, DKIM, and DMARC results.
  4. Check drift: Watch for sources that stop authenticating after provider-side DNS changes.
For a wider check across SPF, DKIM, and DMARC, run the domain health checker after the DNS change has propagated. That broader view matters because SPF success does not guarantee DMARC success when the authenticated return-path domain is unrelated to the visible From domain.
A good rollout has a backout plan. Keep the previous SPF record, know the DNS TTL, and schedule the change when someone can watch DMARC and delivery results for the next few hours.

Common failure modes to avoid

The failures I see most often are not syntax errors. They are operational errors: adding SPF includes for services that never use your return path, flattening once and forgetting it, authorizing broad IP ranges without ownership, and using the root domain for every mail stream.

Mistake

Impact

Fix

Static flattening
Stale IPs
Dynamic refresh
Root overload
Lookup pressure
Subdomains
Unused includes
Permerror risk
Sender audit
Loose softfail
Weak signal
-all
Common SPF management mistakes and the cleaner fix.
The last row is worth calling out. A softfail record can hide messy authorization because receivers still make their own decisions. Once you know your approved senders and have monitoring in place, a hardfail mechanism gives clearer policy intent.
The practical operating rule
Flatten only what you own operationally. If no one can explain why an include exists, who approved it, and how it will be updated, it should not sit in the production SPF record.

Views from the trenches

Best practices
Confirm the return-path domain before adding any vendor include to the root SPF record.
Use managed refresh for flattened SPF so provider IP changes do not break valid mail.
Move distinct mail streams to subdomains before expanding the root domain policy.
Common pitfalls
A one-time flattened record ages badly when upstream sender SPF records change later.
Teams often add vendor includes to domains that vendor mail never uses for SPF at all.
Free static flattening without monitoring creates hidden risk during DMARC enforcement.
Expert tips
Keep a sender inventory with owner, purpose, bounce domain, DKIM domain, and status.
Set alerts for SPF permerror, lookup growth, and new unverified sources immediately.
Treat hosted SPF as change control, not just a way to shorten a DNS TXT record safely.
Marketer from Email Geeks says managed SPF flattening can work well, but moving mail streams to subdomains is often the cleaner long-term answer.
2022-02-10 - Email Geeks
Marketer from Email Geeks says static flattening creates a single operational dependency, so production domains need automatic refresh and support coverage.
2022-02-10 - Email Geeks

The practical rule

The best SPF setup is boring: a short record, clear sender ownership, purpose-built subdomains, monitored authentication results, and no surprise includes. Use a flattener when it helps you stay under the lookup limit, but choose a managed flattener that refreshes upstream data and alerts on failure.
For teams that manage more than one domain or have several senders, Suped is the best overall DMARC platform for this workflow because SPF is handled beside DMARC monitoring, DKIM checks, hosted MTA-STS, blocklist monitoring, and actionable issue steps. That context matters more than simply making a TXT record shorter.

Frequently asked questions

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard
What you'll get with Suped
Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing