CheckSumTech Insights Ideas for the Digital Enterprise
🔍 Search All Articles Generative AI Cloud Digital Transformation Compliance Data & Analytics
SPF too many DNS lookups: the 10-lookup limit explained
🔒 Security · ·

SPF Too Many DNS Lookups: What the 10-Lookup Limit Means and How to Fix It

SPF too many DNS lookups: the 10-lookup limit explained

Your SPF record can look perfectly correct and still fail. The SPF specification (RFC 7208) lets a receiving mail server make at most ten DNS lookups while it evaluates your record. If your record needs an eleventh, the check ends in an error called permerror and SPF does not pass. Nobody emails you about it. You find out when mail starts landing in spam.

10DNS lookups allowed per SPF check
2Void (empty) lookups before it errors

What counts toward the limit

Five mechanisms and one modifier each cost a DNS lookup: include, a, mx, ptr, exists, and the redirect modifier. The ones that cost nothing are ip4, ip6 and all, because the answer is already written in the record itself.

The count is for the whole evaluation, not just your own record. When you write include:some-provider.example, you pay one lookup for the include, plus every lookup inside that provider's record, plus every lookup inside any record that one includes. Large email providers often nest several levels deep, so a single line in your record can quietly cost three or four lookups.

Two smaller details are worth knowing. An mx term counts as one lookup toward the ten, but it also triggers address lookups for each mail server it finds, which the spec caps separately. And ptr is discouraged in the spec itself: it is slow and unreliable, so if you have one, replace it.

There is a second limit as well. A void lookup is a lookup that returns nothing, such as an include pointing at a domain that no longer exists. RFC 7208 says receivers should treat more than two of those as an error too, even if the total is well under ten. A stale include for a service you cancelled long ago is the usual cause.

Counting a record by hand

Here is an illustrative record. The provider names and nested counts are made up to show the arithmetic, so don't read them as real numbers for any specific service.

v=spf1 include:_spf.mailhost-a.example include:_spf.mailhost-b.example include:mail.crm-vendor.example mx a ~all

Suppose mailhost-a nests three more includes, so it costs 4 in total. Suppose mailhost-b nests two, so it costs 3. The CRM vendor's record is flat, so it costs 1. Then mx costs 1 and a costs 1. That is 4 + 3 + 1 + 1 + 1 = 10. This record is exactly at the limit, and adding one more service pushes it over.

There is a trap here. Providers edit their own records without telling you. If a provider adds a nested include, your count goes up even though you changed nothing, and a record that was fine last month can start failing today.

What happens when you go over

The receiving server stops at the eleventh lookup and reports permerror, which means the record is structurally invalid. SPF does not pass, and what happens next depends on the receiver. Some treat it like any other SPF failure; some are more lenient.

Too many lookups is only one of several causes of permerror. Two SPF records on the same name, a syntax slip and an include that points at nothing do the same thing, and they are covered in the SPF PermError guide.

The damage shows up through DMARC. DMARC passes when SPF or DKIM passes and aligns with your From domain. If SPF is broken, your mail depends entirely on DKIM. If DKIM is also missing or not aligned for that sending service, DMARC fails, and if your policy is quarantine or reject, real mail gets sent to spam or bounced.

Domains still on p=none are not safe from this either. Nothing is blocked outright, but failing authentication still counts against you with mailbox providers, which is part of why deliverability slips for no obvious reason.

"A record that was fine last month can start failing today, because the limit is counted across every provider you include, and providers change their records without telling you."

Four ways to get back under 10

1. Delete includes you no longer use. This fixes more records than anything else. Old marketing platforms, helpdesk trials and retired CRMs pile up over the years. Remove the ones you don't send from any more, and the void-lookup risk goes away with them.

2. Check whether each include is doing anything for DMARC. Many email services send using their own bounce domain, so an SPF pass is for their domain and not yours. For DMARC, the include in your record does nothing for those services, and their DKIM signature (which you set up with them as your own domain) is what carries the pass. Confirm with each vendor before you remove anything, but this often frees several lookups.

3. Give a service its own subdomain. If marketing mail goes out from news.yourdomain.com, that subdomain can publish its own SPF record with its own budget of ten lookups, and your main domain's record stays short. This is the cleanest fix when you really do use many senders.

4. Flatten, but carefully. Flattening replaces includes with the ip4 and ip6 addresses they resolve to, which costs zero lookups. The catch is that provider IP ranges change. A hand-flattened record goes stale, and then real mail fails SPF with no sign anything is wrong. Only flatten with something that regenerates the record automatically, and never copy the address ranges of a large provider by hand.

How to check your own count

You can see your SPF, DKIM and DMARC setup for any domain with the free scanner at checksumtech.com/Tools/EmailCheck, no signup needed. The scanner shows whether your records exist and what they say.

A one-off check only helps until the next provider changes something. DeliveryRadar re-scans your domains every day and shows the SPF lookup count for each one on your dashboard, so you can watch it creep toward ten before mail starts failing. There is a 7-day free trial and it doesn't ask for a card.

Sources: RFC 7208, Sender Policy Framework (SPF), section 4.6.4 on DNS lookup limits.

Share:

Check your SPF record

Free, no-signup scan of your SPF, DKIM, and DMARC setup, with a plain-English fix for each issue.

Scan My Domain