How do I fix "Too many DNS lookups" for SPF?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

"Too many DNS lookups" means your SPF record triggers more than 10 DNS queries when a receiver evaluates it. The spec caps it at 10, and once you go over, SPF returns a permerror and your authentication stops passing. Even mail from your legitimate senders gets downgraded.

So The fix is rarely "use a fancy tool." It's almost always "clean up what's in there." Here's the order to try.

1. Count what you actually have

Paste your domain into our SPF checker. You'll see every mechanism, how many lookups each one costs, and exactly where you're over budget. No guessing.

2. Delete senders you stopped using

This is usually where the fat lives. Marketing switched ESPs 2 years ago but the old include never came out. A helpdesk trial ended, the include stayed. Each dead include costs 1 to 3 lookups. Removing 2 or 3 of them often solves the whole problem.

3. Consolidate where you can

If you're running 3 ESPs and 2 CRMs, ask whether you need all 5. Each one chains into nested lookups. Fewer senders, fewer lookups, fewer headaches.

4. Replace heavy includes with specific IP ranges

Still some providers give you a choice: include their full record, or list the ip4: and ip6: ranges directly. Direct IPs cost zero lookups. The tradeoff: if the provider changes IPs, you have to update your record. Only do this when the provider's ranges are stable and you're the one who'll remember to refresh.

5. SPF flattening as a last resort

If you can't reduce the includes and the 10-lookup cap still bites, a managed flattener (EasyDMARC, Valimail) will maintain a synthetic record of raw IPs for you. It works, but you're now trusting a third party to keep your mail flowing. Audit first. Flatten last.

If you've been staring at your SPF record for an hour and every include looks essential, the SOS hotline is free. We've seen every variation of this.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Fix My SPF Lookup Count

I just read the Email Almanac entry on fixing SPF DNS lookup errors. Help me work through my specific SPF record and get it back under 10 lookups without breaking legitimate mail. Walk me through: 1. Which includes in my current record are costing the most lookups 2. Which senders I can safely delete 3. Whether I should consolidate ESPs, switch to IP ranges, or flatten 4. What to monitor after the change so I don't silently break mail --- My details (fill in what applies): - Sending domain: your domain - Current SPF lookup count (if you know): number or unsure - Active sending sources: [list your ESPs, CRMs, helpdesks, Google Workspace, Microsoft 365, etc.] - Services I think I stopped using: list any - DNS management: self-hosted, Cloudflare, hosted by IT team, other - Comfort with SPF flattening: yes, no, not sure

Edit the yellow boxes, then send to the AI of your choice.