Guide
What is SPF flattening?
Your SPF record can only trigger ten DNS lookups. Every service you add uses some up. SPF flattening swaps those lookups for the IP addresses they point to, so your record stays under the limit and your email keeps landing.
Before: too many includes
v=spf1 include:spf.protection.outlook.com include:_spf.google.com include:servers.mcsv.net include:sendgrid.net include:mail.zendesk.com include:_spf.salesforce.com -all
SPF fails, so some genuine email is rejected
After: flattened
v=spf1 ip4:40.92.0.0/15 ip4:209.85.128.0/17 ip4:205.201.128.0/20 ip4:167.89.0.0/17 … -all
Same senders allowed, well within the limit
A quick recap of SPF
SPF is a list in your DNS of the mail servers allowed to send email as you. When an email arrives, the receiving server checks the sender against that list. If the server is not on it, the email may be marked as spam or rejected.
v=spf1 include:example.com include:mailservice.com -all
Each include tells the receiving server to go and look up another record, and that record may include more of its own.
Why you might need it
There is a hard limit
SPF allows ten DNS lookups per check. Go over, and SPF fails for every email you send.It breaks quietly
Nothing warns you. Genuine email simply starts going to spam or being rejected.Flattening fixes it
Replacing includes with a list of IP addresses brings the lookup count back down.
How SPF flattening works
- 1
Collect the includes
Every domain named in an include, and everything those include in turn, is gathered up. - 2
Resolve the addresses
Each one is looked up to find the actual IP addresses of the servers it allows. - 3
Write a flat record
A new SPF record lists those IP addresses directly, with no chain of lookups.
v=spf1 include:example.com include:mailservice.com -all
v=spf1 ip4:192.0.2.1 ip4:192.0.2.2 ip4:198.51.100.1 -all
The benefits
Under the limit
Your record stays within ten lookups, so SPF keeps passing.Better deliverability
Genuine email authenticates properly and is less likely to land in spam.Faster checks
Fewer lookups means receiving servers check your email more quickly.Room to grow
You can add new sending services without breaking your record.
The catch, and how we handle it
Addresses change
Email providers change their IP addresses. A flattened record goes out of date unless someone updates it. We watch for changes and update your record automatically.Records can get long
A flat list of addresses can push against DNS length limits. We keep your record optimised, and split it across subdomains where needed.
Start with a free 14-day trial
We add one DNS record, watch your real email traffic for two weeks, then come back with a plan for your domain. No cost, no commitment.
- 1
Get in touch
Tell us your domain. One of our engineers picks it up.
- 2
Add a record
We send you one DMARC record to add to your DNS.
- 3
Two weeks of data
We see every service sending as you, then propose a plan.
