SPF Flattening Guide

Learn how SPF flattening solves the "too many DNS lookups" problem and how to enable it in DMARC Monitor.

The Problem: SPF 10 Lookup Limit

SPF records have a strict limit of 10 DNS lookups. Each include:, a:, mx:, and redirect: mechanism counts as a lookup. When you exceed this limit, SPF fails completely.

What happens when you exceed 10 lookups?

  • SPF returns a "permerror" (permanent error) result
  • Receiving servers may reject or spam-folder your emails
  • Your DMARC policy can't use SPF for authentication
  • Email deliverability drops significantly

Why Lookups Add Up Quickly

Modern businesses use multiple email services. Each service requires an include: in your SPF record, and these includes often have nested includes themselves:

v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:sendgrid.net include:mailchimp.com include:amazonses.com ~all

This looks like 5 includes, but Google alone expands to 4+ additional includes. You can easily hit 15-20 lookups with just a few services.

The Solution: SPF Flattening

SPF flattening resolves all include: mechanisms to their actual IP addresses. Instead of nested DNS lookups, you get a single record with explicit IPs.

Before (12+ lookups)

include:_spf.google.com include:sendgrid.net include:mailchimp.com ...

After (1 lookup)

include:spf.dmarcmonitor.app

How DMARC Monitor's SPF Flattening Works

  1. We analyze your current SPF record and count DNS lookups
  2. We recursively resolve all includes to their IP addresses (ip4/ip6 ranges)
  3. We host a flattened SPF record at a unique URL on our servers
  4. You update your DNS to include our hosted record
  5. We monitor for IP changes and automatically update the flattened record

Setting Up SPF Flattening

1

Go to your domain's detail page

Navigate to Domains, click on a domain, and scroll to the "SPF Flattening" section.

2

Click "Enable Hosted SPF Flattening"

We'll analyze your current SPF record and show you how many lookups it uses.

3

Copy the new SPF record

We'll give you a new SPF record that includes our hosted, flattened version.

4

Update your DNS TXT record

Replace your existing SPF record with the new one in your DNS provider.

Benefits of SPF Flattening

Stay Under 10 Lookups

Use unlimited email services without hitting the lookup limit.

Faster DNS Resolution

Fewer lookups means faster email delivery checks.

Automatic Updates

When Google or Microsoft change IPs, we update automatically.

Better Deliverability

No more SPF permerrors means more emails reach the inbox.

Frequently Asked Questions

Is SPF flattening safe?

Yes. We simply resolve includes to IP addresses - the same IPs that the original includes would resolve to. Your authorized senders remain exactly the same.

What if an email provider changes their IPs?

We monitor for IP changes and update the flattened record automatically. Major providers like Google and Microsoft occasionally update their IP ranges, and we catch these changes.

Can I disable flattening later?

Yes. You can disable SPF flattening at any time from your domain settings. Just remember to update your DNS back to your original SPF record.

Does this work with all email providers?

Yes. We support all major providers including Google Workspace, Microsoft 365, SendGrid, Mailchimp, Amazon SES, Mailgun, Postmark, and more.