Skip to content

SPF Lookup Limit: How to Fix Too Many DNS Lookups Fast

Why SPF fails after 10 DNS lookups, how to count yours, and how to fix the record.

Nov 14, 2026 4 min read 974 words
SPF Lookup Limit: How to Fix Too Many DNS Lookups Fast

The SPF lookup limit is one of the most common reasons a correct-looking SPF record still fails. Your record can list every sender you use and still return a permanent error, because the receiving server stops counting at ten DNS lookups. This guide explains what the limit is, how to count your lookups, and how to get back under it.

SPF lookup limit diagram idea: one SPF record with too many include mechanisms
SPF lookup limit diagram idea: one SPF record with too many include mechanisms

What is the SPF lookup limit?#

SPF (Sender Policy Framework) lets a domain publish which servers may send mail for it. To check a message, the receiving server reads your SPF record and follows the terms inside it. Some of those terms need extra DNS queries.

RFC 7208 sets the rule. The terms that cause DNS queries are include, a, mx, ptr and exists, plus the redirect modifier. The standard says implementations must limit the total number of those terms to 10 during evaluation. If a check goes past 10, it must return permerror.

The same section also says implementations should limit "void lookups" to two. A void lookup is a DNS query that returns no records or a "name error". Going over that limit also produces a permerror.

Why does going over the SPF lookup limit matter?#

A permerror means the receiver could not evaluate your SPF record at all. SPF then counts as not passed. If you rely on DMARC, a failed SPF check removes one of the two ways a message can align. DKIM can still save the message, but only if it is set up and aligned. Authentication feeds directly into inbox placement, so a broken record is worth fixing quickly.

In practice, you may see more mail going to spam, or DMARC reports showing SPF failures from a service you thought was covered.

Which mechanisms count toward the limit?#

Term Counts as a lookup? Notes
include: Yes Each include costs one, plus every lookup inside the included record
a Yes One lookup
mx Yes One lookup, and the standard also limits the MX names it resolves
ptr Yes Avoid it, the standard discourages it
exists: Yes One lookup
redirect= Yes One lookup, plus the target record
ip4: and ip6: No Literal addresses need no DNS query
all No The final catch rule

The key point is that includes are nested. If you add include: for a marketing platform and that platform's record includes three more names, you spent four lookups, not one.

How do you count your own lookups?#

  1. Fetch your record with dig TXT yourdomain.com and find the line that starts with v=spf1.
  2. Count each term in the table above that causes a query.
  3. For every include: and redirect=, fetch that record and count its terms too, repeating until you reach records with only IP addresses.
  4. Add them up. More than 10 means you are over the limit.

You can also use a checker. Our SPF checker reads a record, and many DNS tools report the lookup total. Run the check again after every change, since a vendor can add includes to its own record without telling you.

How do you fix too many DNS lookups?#

Work through these options, from easiest to most involved.

Remove senders you no longer use#

Old trials and retired tools are the usual cause. List every service that sends mail as your domain, and delete the include for each one you no longer use.

Replace includes with IP addresses#

If a service publishes fixed sending IPs, you can list them with ip4: and ip6:, which cost no lookups. The risk is that the vendor changes its IPs and your record goes stale. Only do this when the vendor documents stable ranges and tells you about changes.

Use a subdomain per sender#

Send marketing mail from news.yourdomain.com and transactional mail from mail.yourdomain.com. Each subdomain has its own SPF record and its own budget of ten lookups. This also keeps one stream's reputation away from the other.

Drop ptr and trim mx and a#

Remove ptr entirely. Replace a and mx with the specific IPs if your own mail server never changes.

Consider SPF flattening carefully#

Flattening tools replace includes with the resulting IP lists and refresh them on a schedule. It works, but it adds a dependency: if the refresh breaks, your record goes out of date. Treat it as a last step and monitor it.

Keep the SPF lookup limit from creeping back#

  • Review your SPF record each quarter and after every new tool that sends mail.
  • Keep one owner for DNS changes, so nobody adds an include on their own.
  • Read your DMARC aggregate reports for sudden SPF failures.
  • Before you launch a campaign, check your domain with the Tomba Email Verifier on your list so authentication is not the only thing you control.

Frequently asked questions#

What happens if I go over 10 lookups?#

The receiving server returns permerror, and SPF does not pass for that message.

Do ip4 and ip6 count toward the limit?#

No. They are literal addresses and need no DNS query.

Can I have two SPF records to get around the SPF lookup limit?#

No. A domain should publish a single SPF record, so splitting terms across two records does not raise the SPF lookup limit. Merge your terms into one v=spf1 line.

Is the limit the same for every receiver?#

The standard sets 10 as a maximum that implementations must enforce. Treat 10 as your hard ceiling and leave some room.

Next step#

Fix the record, then confirm your list is clean before you send. Run your contacts through the Tomba Email Verifier so bounces do not hurt the sender reputation you just protected.

// 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

Share
0 clapsEnjoyed it? Give a clap.
AU

// about the author

Tomba Editorial Team

Was this helpful?