SPF Record Lookup Limit: How to Fix the 10 DNS Lookup Error
The SPF record lookup limit is 10 DNS lookups. Here is what counts, how to see where you stand, and four ways to get back under it.

The SPF record lookup limit is a hard cap of 10 DNS lookups per check. Go over it and receiving servers return a permerror, which means your SPF result is not a pass. Many senders hit it without noticing, because every tool you add to your SPF record can add several lookups. This guide shows what counts, how to measure your record and how to get back under the limit.
TL;DR#
- SPF allows at most 10 DNS-querying terms per evaluation, as set by RFC 7208.
include,a,mx,ptr,existsandredirectcount.ip4,ip6andalldo not.- Nested includes count too, so one vendor can use several lookups.
- Fix it by removing unused senders, replacing includes with IPs, or splitting senders across subdomains.
What is the SPF record lookup limit?#
SPF lets a domain list the servers allowed to send its mail. To check a message, the receiving server reads your SPF record and follows its terms. Some terms need extra DNS queries. RFC 7208 caps those queries at 10 so that a single message cannot trigger endless DNS work.
If the count passes 10, the check ends with a permerror. Receivers then treat SPF as failed or unusable for that message. Your DKIM and DMARC setup may still save the message, but you lose one of your three authentication signals.
Which terms count toward the SPF record lookup limit?#
The rule is simple: if a term needs a DNS query to resolve, it counts.
| Term | Counts toward the limit? |
|---|---|
include: |
Yes, plus every lookup inside the included record |
a |
Yes |
mx |
Yes |
ptr |
Yes (and RFC 7208 says not to use it) |
exists: |
Yes |
redirect= |
Yes |
ip4: and ip6: |
No |
all |
No |
Two details trip people up. First, the count is recursive. If you include a vendor and that vendor includes three more records, you have used four lookups, not one. Second, the mx term can trigger extra address lookups for each mail host it returns, and the standard limits those too.
Signs you have passed the limit#
You may see one of these:
- An SPF checker reports "too many DNS lookups" or
permerror. - DMARC reports show SPF failing for mail you know is authorized.
- A new sending tool works at first and then SPF breaks after you add it.
Check your record with a lookup tool. The SPF checker reads a domain's record so you can count terms by hand. For each include, open the included record and count its terms as well.
Step 1: list every sender in your SPF record#
Write down each include, a and mx term and what it is for. Typical entries are your mailbox provider, a marketing platform, a CRM, a support desk and a billing system.
Then ask one question per entry: does this still send mail for us? Teams often keep the include for a tool they stopped using years ago.
Step 2: remove senders you no longer use#
This is the cheapest fix. Delete includes for retired tools, and drop a or mx terms if your web server and mail server are already covered by an ip4 entry or another include.
Before you remove anything, confirm in your DMARC aggregate reports that no mail is still sent through that source. Reports show which IPs sent mail as your domain, so you can match them to the vendor.
Step 3: replace includes with IP ranges (flattening)#
SPF flattening swaps an include: for the IP addresses it resolves to. Since ip4 and ip6 terms are free, a flattened record uses fewer lookups.
The trade-off is maintenance. Vendors change their sending IPs, and a flattened record does not follow them. If you flatten by hand, you must recheck it on a schedule. Otherwise legitimate mail starts to fail. Many teams use an automated flattening service for this reason, or only flatten vendors that rarely change.
Use flattening for stable senders, such as your own mail servers. Leave large, changing providers as includes.
Step 4: send from subdomains#
Each domain and subdomain has its own SPF record, with its own count of 10. Moving a sender to a subdomain gives it a fresh budget.
For example:
example.comkeeps your company mailboxes.mail.example.comsends marketing campaigns.outreach.example.comsends sales sequences.
This also protects your main domain. If a campaign hurts sender reputation, it harms the subdomain first. Separate streams are easier to monitor and to fix.
Step 5: keep only one SPF record#
A domain must publish a single SPF record. Two v=spf1 TXT records on the same name cause a permerror of their own. If you find two, merge them into one record that lists all the terms.
End the record with a single all term. A common choice is ~all (soft fail) while you test and -all (hard fail) once you are sure the list is complete.
Void lookups: a second SPF record lookup limit#
RFC 7208 also advises limiting "void lookups", which are queries that return no data or a non-existent domain. The suggested cap is 2. A record that points to dead includes can fail on this rule even when the total is under 10. Fix by removing terms that point to domains that no longer exist.
Test your SPF record lookup limit before and after changes#
- Copy your current record to a safe place.
- Edit it, then run it through an SPF checker.
- Send a test message to a mailbox you control and read the
Authentication-Resultsheader forspf=pass. - Watch your DMARC reports for a week.
Check your SPF record lookup limit again after every new sending tool. Also verify the addresses you send to. Authentication protects your domain, but bounces still hurt your reputation, so run lists through an email verifier before a campaign.
Frequently asked questions#
What is the SPF record lookup limit?#
It is 10 DNS lookups for mechanisms and modifiers such as include, a, mx, ptr, exists and redirect. The limit comes from RFC 7208.
What happens if I exceed the SPF lookup limit?#
The receiving server returns a permerror. SPF does not pass, and some mail may be filtered or rejected depending on your DMARC policy.
Do ip4 and ip6 count as lookups?#
No. They hold addresses directly, so the receiver needs no DNS query to read them.
Is SPF flattening safe?#
It works, but it needs upkeep. If a vendor changes its IPs and your flattened record does not, mail from that vendor can fail SPF.
Can I have two SPF records?#
No. Publish one v=spf1 record per domain and merge your terms into it.
Next step#
Authentication is only part of the job. Keep your lists clean as well. Try the Tomba Email Verifier to check addresses before you send.
// start free
See who Tomba finds at any company
Type a company's domain to see its people, their roles and verified work emails, each with the pages it was found on. Free account, no card.
Free plan · No credit card required · GDPR & CCPA