Email authentication error
SPF flattening: pros, cons and the risk of stale IP addresses
SPF flattening replaces the include terms in your record with the IP addresses those includes resolve to. Because an address written directly costs no DNS lookup, flattening can bring a record back under the limit of 10 lookups set by RFC 7208. It is a real fix, and it is also the one most likely to fail months later without anyone noticing.
By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.
This page sets out what flattening does well, where it goes wrong, and how a small business can decide whether to use it. If you are not yet sure you are over the limit, start with our guide to too many DNS lookups.
What flattening actually does
Take a record that includes your mailbox provider, your invoicing tool and your newsletter platform. Each include points to another record, which may point to more. Flattening follows every one of those, collects the ip4 and ip6 ranges at the end, and publishes them in your own record in place of the includes.
The result is a long record that needs few or no lookups. RFC 7208 section 4.6.4 counts only the terms that trigger a DNS query, and ip4 and ip6 are not among them. A flattened record therefore passes the lookup count easily.
The advantages
It solves the limit when you genuinely cannot remove a sender. A business with a mailbox suite, an accounting package, a booking tool, a helpdesk and a marketing platform can reach the ceiling without any waste in the record.
It also speeds up evaluation, since the receiver makes fewer queries, and it removes the failure that comes from a provider's own record being temporarily unreachable during your check.
The risks
The central problem is staleness. A provider can add or retire sending addresses at any time, and it publishes the change in its own record, not yours. If you copied the addresses by hand last year, the new ones are missing from your record and the provider's mail starts to fail SPF. The failure is partial and intermittent, because only mail leaving from a new address is affected, which makes it hard to trace.
Size is the second problem. A DNS TXT record is split into strings of up to 255 characters, and the whole response should fit in a normal UDP packet. A heavily flattened record can grow past what some resolvers handle well. RFC 7208 section 3.4 warns publishers about this and about total record length.
The third risk is ownership. When you include a provider, you hand it the job of keeping the list current. When you flatten, that job is yours or your flattening service's, and a lapse in that service can silently break mail.
Safer choices to try first
Remove includes for services you have cancelled, which is free. Check DMARC aggregate reports for the real list of senders before you delete anything. Next, move bulk or marketing senders onto a subdomain with its own record and its own lookup budget, and make sure that sender signs with DKIM so DMARC can pass even if SPF is under strain.
If you still need flattening, use a managed service that re-reads the providers on a schedule and republishes your record, and make sure someone is told when it fails. A one-off copy and paste is the version that causes problems later. Our SPF builder can show you the count before and after.
Decide on and run SPF flattening safely
- Count your current lookups and confirm you really are over 10.
- Remove includes for cancelled services before changing anything else.
- List every sender in your DMARC reports and mark which ones still send.
- Move newsletter and marketing senders to a subdomain with its own record.
- Confirm each remaining sender signs with DKIM for your domain.
- If you flatten, choose a service that refreshes addresses automatically.
- Keep the original unflattened record in your notes as a rollback.
- Check the final record fits in DNS strings of 255 characters or fewer.
- Name one person who gets an alert when the refresh fails.
- Review DMARC reports monthly for SPF failures from known senders.
Questions people ask
Is SPF flattening against the standard?
No. The standard allows ip4 and ip6 terms and sets no rule against copying addresses. It does warn that publishers must keep the record accurate, which is the weak point of flattening.
How often do provider IP addresses change?
It varies by provider and is not published in one place. That uncertainty is the reason to prefer includes or an automated refresh over a hand copy.
Will flattening fix DMARC failures?
Only those caused by the SPF lookup limit. DMARC failures from alignment, or from a sender that is not in the record, need a different fix.
Can I flatten just one include?
Yes. Flattening only the deepest or most stable include is a sensible middle path, and it lowers the count while leaving the others to be maintained by their providers.
Where to from here
The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.
Sources
- RFC 7208, Sender Policy Framework, sections 3.4 and 4.6.4
- ASD, how to combat fake emails
- RFC 7489, DMARC
General information, not legal advice. Laws and guidance change: check the linked primary sources and ask a qualified adviser about your own situation. Written by Kyle Deligny with AI assistance, last reviewed 1 December 2026. How we write and check: editorial policy.
