Email Infrastructure

SPF Flattening

Resolve SPF's 10-lookup limit by pre-resolving all includes to raw IPs and hosting a maintained flat record.

⚡ Monitored by EmailExacto Intelligence

What is SPF Flattening?

SPF flattening resolves all include: mechanisms recursively to their underlying IP addresses and publishes a simplified record containing only those IPs. It solves SPF's hard 10 DNS lookup limit — a constraint in the specification that causes a PermError when exceeded. As businesses add more ESPs, CRMs, and marketing platforms, each with their own include:, exceeding 10 lookups is common and causes silent SPF failures.

How It Works

A standard record can quickly exhaust the budget:

v=spf1 include:_spf.google.com include:amazonses.com include:_spf.salesforce.com include:servers.mcsv.net include:spf.protection.outlook.com ~all

Flattening resolves each include to raw IPs, replacing the chain with direct ip4: entries. Because ESPs change their IPs over time, a flattening service must monitor upstream includes and regenerate the flat record automatically. You then point DNS to the hosted flat record:

v=spf1 mx include:abc123def456.spf.emailexacto.net ~all

Why It Matters

When SPF exceeds 10 DNS lookups it returns a PermError — which receivers typically treat the same as a hard fail. This causes legitimate email to fail SPF and potentially fail DMARC if DKIM isn't aligned either. The failure is silent: your ESP reports delivery, but email is being filtered at the receiver.

How EmailExacto Helps

Automatic SPF Flattening in EmailExacto

EmailExacto automatically detects when your domain approaches the 10-lookup limit and activates flattening, hosting your flat record and keeping it current.

  • Automatic candidate detection — flags domains approaching 9+ lookups
  • Flat record hosted at {token}.spf.emailexacto.net via Cloudflare DNS
  • 39 ESP includes pre-seeded: Google, Microsoft, SendGrid, Mailchimp, and more
  • Nightly refresh at 01:00 UTC — updates IPs when upstream ESPs change their records
See EmailExacto Intelligence →

What to Get Right

Check your SPF lookup count regularly — each include: can cost multiple lookups.

Use a flattening service rather than maintaining the flat record manually.

Keep your canonical SPF record source in version control.

Pair SPF flattening with DKIM signing so DMARC has a second alignment path.

Monitor your flat record after flattening — a refresh failure leaves your SPF stale.

Test SPF after flattening to verify the record evaluates correctly.

Related Topics

Free Weekly Training

Get a Free Email Deliverability Lesson Every Week

Expert-written training delivered to your inbox every Tuesday. No spam. Unsubscribe anytime.

Join thousands of senders building better email habits.