SPF flattening
Rewriting an SPF record so that includes are replaced by the IP addresses they resolve to, bringing the record under the ten-lookup limit.
What it means
Flattening resolves every include, a and mx in a record ahead of time and publishes the resulting addresses as ip4 and ip6 entries, which need no DNS lookups. The technique is not part of the SPF specification; it works because RFC 7208 exempts ip4 and ip6 from the limit of ten lookups.
The weakness is staleness. Providers change their sending addresses without notice, and a flattened copy does not follow. Mail from the new addresses then fails SPF until someone updates the record. Services that flatten automatically re-resolve on a schedule, which narrows the gap but adds a dependency.
Flattened records also grow long, and RFC 7208 asks that SPF answers stay small enough for a 512-byte DNS response. Splitting senders across subdomains is often the cleaner fix.
Related terms
On this site
Sources
What this definition rests on. The wording is ours; the facts are theirs.
- RFC 7208: Sender Policy Framework (SPF), section 4.6.4rfc-editor.org
- RFC 7208: Sender Policy Framework (SPF), section 3.4rfc-editor.org
All 432 terms in the glossaryThe wiki: blocklists and bounce codes