SPF flattening explained

Short answer

SPF flattening replaces include: mechanisms with the actual ip4:/ip6: ranges they resolve to, eliminating DNS lookups to stay under the 10-lookup limit. It works, but it’s fragile: when a provider changes its IPs, a static flattened record breaks. Use an auto-updating service and monitor it.

How it helps

Because ip4:/ip6: mechanisms cost zero DNS lookups, converting includes to IPs removes lookups and resolves PermError. It’s a direct fix for “too many DNS lookups.”

The catch

Providers rotate IPs. A hand-flattened record silently fails when they do, bouncing legitimate mail. If you flatten, use a managed service that keeps the record current, and prefer removing unused includes first.

Check your SPF record now

Open the free SPF checker →

Frequently asked questions

Is flattening safe?

Only with automation that updates the record when providers change IPs. A static flattened record is a known cause of sudden deliverability failures.

The 10-lookup limit is in RFC 7208 §4.6.4.

Reviewed by the Skysnag Security Team. Last updated .