The SPF Record Guide: Why 'Too Many Lookups' Kills Your Emails
Your SPF record silently breaks the moment it exceeds 10 DNS lookups โ and most senders have no idea it's happening. Here's exactly how to diagnose and fix the 'PermError' that's killing your deliverability.
Your cold emails are authenticated, your domain is warmed up, and your copy is solid โ but you're still landing in spam. Nine times out of ten, the culprit is a broken SPF record nobody bothered to check.
The SPF record too many lookups fix is one of the most overlooked deliverability wins in cold email. It's not glamorous. It doesn't involve AI or copywriting frameworks. But fixing it can move you from a 40% inbox rate to an 85%+ inbox rate overnight โ I've seen it happen.
What SPF Actually Does (And Why It Breaks)
SPF (Sender Policy Framework) is a DNS TXT record that tells receiving mail servers: "These are the IP addresses and services authorized to send email on behalf of my domain."
When Gmail or Outlook receives your email, they query your domain's SPF record to verify you're legit. If the check passes, great. If it fails โ or if your record is malformed โ you get a PermError, which many receiving servers treat the same as a hard SPF fail.
Here's the rule that breaks everything: RFC 7208 limits SPF records to a maximum of 10 DNS lookups. Not 10 entries. 10 lookups. There's a difference.
Every include:, a, mx, and ptr mechanism in your SPF record triggers at least one DNS lookup. Some include: statements nest further includes inside them, each costing additional lookups. Before you know it, you've got 15 lookups in a record that looks perfectly reasonable on the surface.
The Lookup Count That Surprises Most People
Here's a real SPF record I audited for a client last year:
v=spf1 include:_spf.google.com include:sendgrid.net include:spf.protection.outlook.com include:amazonses.com include:mailchimp.com include:_spf.salesforce.com include:sparkpostmail.com ~all
Seems fine, right? Seven includes. But when you resolve each one:
| Include | Direct Lookups | Nested Lookups | Total |
|---|---|---|---|
_spf.google.com |
1 | 2 | 3 |
sendgrid.net |
1 | 1 | 2 |
spf.protection.outlook.com |
1 | 1 | 2 |
amazonses.com |
1 | 2 | 3 |
mailchimp.com |
1 | 1 | 2 |
_spf.salesforce.com |
1 | 3 | 4 |
sparkpostmail.com |
1 | 1 | 2 |
| Total | 18 |
Eighteen lookups. Nearly double the limit. Every email sent from this domain was hitting a PermError and the team had zero idea.
How to Diagnose Your SPF Lookup Count Right Now
This takes under 5 minutes. Use our free SPF/DKIM/DMARC Checker to instantly see your current record and whether you're over the limit.
If you want to do it manually:
- Go to your terminal and run:
dig TXT yourdomain.com - Find the line starting with
v=spf1 - Count every
include:,a, andmxmechanism - For each
include:, rundig TXT [that-domain]and count their includes recursively
Or just use the tool. Life's too short.
What the results mean:
- Under 10 lookups + passes: You're fine. Move on.
- Under 10 lookups + PermError: You have a syntax error somewhere.
- Over 10 lookups: You have the too-many-lookups problem. Keep reading.
- No SPF record at all: Stop everything and fix this first. Check out why your cold emails are landing in spam for the full authentication picture.
Stop paying monthly
Cleanmails โ self-hosted cold email infrastructure.
The SPF Record Too Many Lookups Fix: 3 Approaches
Approach 1: SPF Flattening (The Blunt Instrument)
SPF flattening means resolving all those include: statements to their underlying IP addresses and putting the raw IPs directly in your record. No nested lookups โ just a flat list of IPs.
Before (8+ lookups):
v=spf1 include:_spf.google.com include:sendgrid.net ~all
After (0 lookups for those includes):
v=spf1 ip4:209.85.128.0/17 ip4:74.125.0.0/16 ip4:167.89.0.0/17 ip4:208.117.48.0/20 ~all
The problem with flattening: Those IP ranges change. SendGrid, Google, and others regularly update their IP pools. A flattened record becomes stale, and now you're getting SPF fails for legitimate emails because you're not including the new IPs. You'd need to re-flatten every few months.
Flattening is fine as a temporary fix. It's not a long-term strategy.
Approach 2: Audit and Remove Unnecessary Includes (The Right Answer)
This is what I actually recommend. Most SPF records are bloated because someone added a new service six months ago and nobody cleaned up the old ones.
Step 1: List every service in your SPF record.
Step 2: For each one, ask: Are we actively sending email through this service right now?
Not "did we use it once" or "we might use it later." Right now.
Step 3: Remove every service you're not actively using.
I audited a SaaS company's SPF record last quarter and found includes for:
- A transactional email provider they'd switched away from 2 years ago
- A CRM they'd cancelled
- A marketing automation tool they'd migrated off of
Removing those three dropped them from 14 lookups to 7. Problem solved in 10 minutes.
Step 4: For the services you are using, check if any of them offer a macro-based or optimized SPF record that uses fewer lookups.
Approach 3: Use an SPF Optimization Service
Tools like AutoSPF or dmarcian's SPF Surveyor can dynamically manage your SPF record, keeping it under the 10-lookup limit even as your vendors change their IP pools. They work by serving a single include: that points to their dynamically updated record.
This is the right call if you're genuinely sending through 6+ services and can't consolidate.
The Sending Infrastructure Lesson Most People Miss
Here's the contrarian take: the real fix for too many SPF lookups is using fewer sending services.
Most cold emailers accumulate sending services the way developers accumulate npm packages โ one for this, one for that, a backup for the backup. Each one adds SPF bloat, DKIM complexity, and another vendor dependency.
If you're running cold email campaigns, you don't need SendGrid and Mailgun and a dedicated SMTP relay and Google Workspace. You need one solid sending infrastructure that you control.
This is part of why I use Cleanmails for client campaigns โ it has inbuilt SMTP, which means I'm not chaining together five different services and inheriting their SPF baggage. One platform, one clear sending path, one clean SPF record. The tool itself is also what I'd recommend checking out if you're tired of debugging deliverability issues that originate from infrastructure complexity. (And at a one-time $497, it beats paying monthly for tools that create these exact problems โ more on that in why monthly cold email subscriptions are killing your ROI.)
What Happens When You Exceed 10 Lookups: The Actual Mechanics
When a receiving server hits your 10-lookup limit and can't finish evaluating your SPF record, it returns a PermError. RFC 7208 is explicit: this is a permanent error, not a temporary one.
Different mail servers handle PermError differently:
- Gmail: Treats PermError as a neutral result โ not a pass, not a fail. Your email might still get delivered, but you lose the authentication signal that helps inbox placement.
- Microsoft/Outlook: Often treats PermError as a fail. Your email gets junked or rejected.
- Strict enterprise mail servers: Hard reject on PermError.
This is why a broken SPF record doesn't always cause 100% failures โ it causes inconsistent failures that are maddening to debug. You'll see 70% inbox placement and assume everything's fine, not realizing you're getting hard-rejected by every Microsoft-hosted domain on your list.
For a full view of how authentication failures cascade into deliverability problems, this post on why 93% of cold emails never get opened covers the complete picture.
The 30-Minute Fix Checklist
Do this right now:
- Check your SPF record using the SPF/DKIM/DMARC Checker โ note your lookup count
- List every service in your current SPF record
- Log into each service and verify you're actively using it for sending
- Remove dead includes from your SPF record in your DNS provider
- Re-check the lookup count โ confirm you're under 10
- Verify SPF alignment โ make sure your
From:domain matches your SPF domain - Send a test email to mail-tester.com or GlockApps and confirm SPF passes
While you're auditing your deliverability setup, also run your list through the Bulk Email Verifier โ hard bounces from invalid addresses damage your sender reputation just as much as authentication failures.
One More Thing: SPF and DMARC Alignment
Fixing the lookup count is necessary but not sufficient. Your SPF record also needs to align with your DMARC policy.
Alignment means the domain in your Return-Path (the envelope sender) must match your From: domain. If you're sending from yourcompany.com but your ESP uses mail.sendgrid.net as the envelope sender, SPF will pass for sendgrid.net but fail DMARC alignment for yourcompany.com.
The fix: configure your ESP to use a custom Return-Path subdomain on your own domain (e.g., bounce.yourcompany.com). Most enterprise ESPs support this. If yours doesn't, that's a red flag.
A solid weekly cold email health check should include verifying SPF/DKIM/DMARC alignment โ not just once when you set it up, but on a recurring basis, because DNS records get edited and services get added without anyone updating the authentication records.
The Bottom Line
SPF's 10-lookup limit is a hard technical constraint from the RFC, not a suggestion. Exceeding it silently breaks your authentication for a subset of recipients โ often the most valuable ones on Microsoft-hosted corporate domains.
The fix isn't complicated. Audit your includes, remove the dead weight, and if you're still over the limit, flatten or use an optimization service. But the real lesson is to stop accumulating sending services you don't need. Simpler infrastructure means cleaner authentication, better deliverability, and fewer hours debugging DNS records at midnight.
Fix your SPF record today. It takes 30 minutes and the deliverability gains are immediate.
Related:
Stop paying monthly for cold email.
Cleanmails โ self-hosted, unlimited everything, $200 one-time.



