Skip to content

Tools is made by Valley.

See how ↗

Tools is made by Valley.

See how ↗

Tools is made by Valley.

See how ↗

Free tool · 04 / SEND

SPF flattener.An SPF record under 10 lookups, no signup.

Turns an SPF record's includes into IP addresses to get under the 10-lookup limit.

We look this up and don't keep it.

Try: · ·

An example: a made-up domain with six providers, every address from the documentation ranges.

The record as published

v=spf1 include:_spf.mailsuite.example include:spf.officemail.example include:crm.example include:sales.example include:helpdesk.example include:marketing.example ~all

Lookups as published
13
Lookups flattened
4
Characters
246
  • As published, the record costs 13 DNS lookups, over RFC 7208's limit of 10, so receivers return a permanent error.
  • Flattened, it costs 4, with 10 IP address ranges listed directly.
  • A flattened record is a snapshot: when a provider changes its addresses, an include follows and copied IPs don't. Microsoft says to review flattened entries at least quarterly; re-flatten on a schedule, or keep that provider as an include.

Publish it as one TXT record at your domain, in place of the old one. We don't change your DNS or keep your domain.

Valley sends from your own Gmail or Microsoft inbox, so the include it needs is one your record already has. See how Valley does it ↗

Built by Valley ↗

NEXT STEP

Fed up with tuning DNS records instead of talking to buyers.The other half is who, and what you say.

Book a demo ↗

$500 a month for your first seat, $200 for each seat after that.

The limits

What counts toward SPF's 10-lookup limit?RFC 7208's rules, term by term.

Every include, a, mx, ptr and exists mechanism, and the redirect modifier, costs one DNS lookup, and RFC 7208 caps them at 10 per check; past that, receivers return a permanent error. ip4, ip6 and all cost nothing, which is why flattening includes into IP addresses brings the count down.

SPF terms, whether each costs a DNS lookup, and what flattening does with it, from RFC 7208
TermCosts a lookup?When flattened
include:Yes, plus every lookup inside itReplaced by the IPs behind it, or kept
a, mxYesReplaced by the addresses they resolve to
redirect=YesReplaced by the target record's IPs
ptr, existsYesKept as written: they can't become fixed addresses
ip4:, ip6:NoKept
allNoKept, with its qualifier

RFC 7208 also limits void lookups, ones that find no record, to two.

From RFC 7208: Sender Policy Framework (SPF), §3.3, §3.4 and §4.6.4 ↗, read 17 Nov 2026

How it works

How this tool works.And what it can't see.

Type a domain. Our server reads its SPF record and follows every include, redirect, a and mx term down the tree, at most 40 lookups, resolving a and mx terms to addresses. Your browser then builds the flattened record: the domain's own IPs, each include either replaced by the IPs behind it or kept as it is, and the original all.

It counts lookups before and after, splits a record longer than 255 characters into quoted strings (RFC 7208 joins them back together), and warns past 450 octets. Microsoft 365's include is kept by default, because Microsoft says not to flatten it.

What it can't do is keep the record current. A flattened record copies today's addresses; when a provider changes them, the record goes stale until you flatten it again. We don't change your DNS or keep your domain.

Built by Valley.

Sources

SPF flattening

Flatten SPF without breaking mail.Fewer lookups, and the includes you shouldn't touch.

Every tool you send from adds an include. Here's how to get under the limit without losing mail.

  1. 01

    Why the limit bites

    RFC 7208 caps the DNS-querying terms in one SPF check at 10, counting includes inside includes, and says a receiver must return a permanent error past that. Microsoft notes that fewer than 10 include: statements doesn't guarantee fewer than 10 lookups, because each include can contain more.

    From RFC 7208: Sender Policy Framework (SPF), §3.3, §3.4 and §4.6.4 ↗ · Microsoft Learn: Set up SPF to identify valid email sources for your Microsoft 365 domain ↗, read 17 Nov 2026

  2. 02

    Keep the big providers as includes

    Microsoft's guide says not to flatten Microsoft 365's include, because its sending infrastructure uses dynamic IP addresses that change frequently, and to review any flattened entries at least quarterly. Google's setup page gives v=spf1 include:_spf.google.com ~all for Google Workspace. Flatten the small, stable senders first, and keep includes for providers whose addresses move.

    From Microsoft Learn: Set up SPF to identify valid email sources for your Microsoft 365 domain ↗ · Google Workspace Admin Help: Set up SPF ↗, read 17 Nov 2026

  3. 03

    Long records, and the 512-octet line

    A TXT string holds 255 characters, so a longer SPF record is published as several strings in one record, which RFC 7208 says receivers join together without spaces. The RFC also says the record should stay small enough for the DNS answer to fit in 512 octets, and that answers under 450 octets ought to fit in a UDP packet.

    A record under 10 lookups gets your mail authenticated. Getting it answered is a different job. See how Valley does it ↗

    From RFC 7208: Sender Policy Framework (SPF), §3.3, §3.4 and §4.6.4 ↗, read 17 Nov 2026

Questions

Questions people ask.

What is SPF flattening?
Replacing the include: terms in an SPF record with the IP addresses they resolve to, so the record costs fewer DNS lookups.
What is the SPF 10 lookup limit?
RFC 7208 allows at most 10 DNS-querying terms (include, a, mx, ptr, exists and redirect) in one SPF check; past that, receivers return a permanent error.
Do ip4 and ip6 count toward the SPF lookup limit?
No. ip4, ip6 and all cost no DNS lookup, which is why flattening includes into IPs lowers the count.
Should I flatten Microsoft 365's SPF include?
No. Microsoft says not to flatten include:spf.protection.outlook.com, because its sending IP addresses change frequently.
How long can an SPF record be?
Each TXT string holds 255 characters, and longer records use several strings that receivers join. RFC 7208 asks for the answer to fit in 512 octets.
How often should I re-flatten SPF?
Whenever a provider changes its addresses. Microsoft says to review flattened entries at least quarterly.
Is this SPF flattener free?
Yes. It's free and needs no signup. We look up the domain you type and don't keep it.