SPF flattening

Short answer

What is SPF flattening?

SPF flattening means replacing include, a and mx in the SPF record with the fixed IP addresses they point to, so the record uses fewer DNS lookups. It solves the limit of 10 lookups, but the IP addresses of services like Microsoft 365 and Google change without notice, so a flat record must be updated regularly.

Enter the domain. We look up the whole SPF tree and build the record with only ip4 and ip6.

Important about upkeep

Services like Microsoft 365 and Google change their IP addresses without notice. A flat record must therefore be updated regularly, or genuine email may fail. Hosted SPF in Micronet DMARC does this automatically.

How to use the tool

  • Enter the domain. We look up the whole SPF tree and collect all ip4 and ip6 addresses.
  • The result shows how many lookups the record uses before and after.
  • If the record gets too long, it is split into several records included from the main record.
  • Read the notes before you use the suggestion.

Example

Before: v=spf1 include:_spf.service.com mx -all. After: v=spf1 ip4:203.0.113.0/24 ip4:198.51.100.7 -all. The new record uses no lookups, but no longer keeps up when the service changes its addresses.

When flattening fits

Flattening fits best for your own servers and small services with fixed addresses. For large cloud services it is safer to keep the include and instead remove services or move some of them to a subdomain.

Questions and answers

Will the record be too long?

Above 450 characters it is split into several records (spf1, spf2 ...) included from the main record.

How often must a flat record be updated?

Often enough to catch changes before they cause errors. Check at least every week, or let a system do it automatically.

Can I flatten only part of the record?

Yes, and it is often wise. Keep the include for Microsoft 365 or Google, and turn only the small services into fixed addresses.

Is my record sent to you?

No. We only look up public DNS records for the domain, and the suggestion is built in the browser. We do not store who checked what.