Skip to content
GDPR compliant. Hosted in the EU.
14-day free trial →
RFC 7208Nested includesDNS monitoring
Security 17 min read 3 Dec 2026

SPF fails without a change: the limit of ten DNS lookups

SPF record unchanged yet ineffective? From the eleventh DNS lookup it ends in a permerror. How nested includes and redirect modifiers count toward the limit.

X

XICTRAQ®

XICTRAQ®

SPFEmail authenticationDNS-Monitoring
10
DNS lookups as the upper limit per SPF evaluation, nested records included (RFC 7208)
6
terms count: include, a, mx, ptr, exists and redirect (RFC 7208)
2
empty DNS answers is the additional limit the standard recommends (RFC 7208)
Three includes, eleven DNS lookupsSPF tree of shop.example: each numbered node costs one DNS lookup.Numbered in evaluation order, nested records count too.DNS lookups11 / 10shop.examplev=spf1 … -allMailbox service1include:mail.exampleNewsletter service5include:news.exampleTicket system8include:help.example2include:a.mail.example3include:b.mail.example4include:c.mail.example6include:eu.news.example7a:out.news.example9include:eu.help.example10include:us.help.example11include:new.help.examplepermerrorCounts toward limitincludeamxptrexistsredirectDoes not countip4ip6allexpLimit: 10 lookups per evaluation11th lookup: permerrorSource: RFC 7208, section 4.6.4 · Example with invented names under the reserved .example top-level domain
Your domain's SPF record has sat unchanged in DNS for months, yet receivers suddenly report an error, or the mail from one particular service lands in spam. Often the cause is not in your zone but with the sending services you have added via include: their records keep growing on their side, and SPF counts every DNS lookup across the whole tree. From the eleventh lookup, evaluation ends in a permerror (RFC 7208). This article shows which terms count, how nested include and redirect fill up the counter and how to weigh the options when consolidating.

Why an unchanged SPF record suddenly fails

An SPF record is a TXT record that starts with v=spf1 and defines which servers may send mail using your domain in the envelope. For your own servers it lists addresses (ip4, ip6) or references to your own names (a, mx). For external sending services it almost invariably contains an include, a reference to the service's record. This mechanism triggers a recursive evaluation of the included record (RFC 7208). What that record contains is decided by the service, not by you. How a record is built in the first place is covered in setting up SPF, DKIM and DMARC.

The limit of ten DNS lookups does not apply per record but to the entire evaluation. The standard requires it to be tracked as one single, global limit across all recursive steps (RFC 7208). If your mailbox service includes three further records in its own record, that one reference costs you four lookups. If the service later splits its record further, for example because new data centers or address ranges are added, your counter rises without a single character changing in your zone.

Once the limit is exceeded, the check must return permerror (RFC 7208). A permerror means that the domain's published records could not be correctly interpreted (RFC 7208), and according to the standard, fixing it requires intervention by whoever operates the DNS (RFC 7208).

Note: Why the error often hits only part of your mail

The check works through the mechanisms from left to right. If one matches, evaluation ends with its result (RFC 7208). Mail from a service listed early often does not reach the eleventh lookup. The first to be hit are the servers at the end of the tree and any mail from an unlisted server. Typically, invoice emails then arrive while replies from the ticket system do not. Spoofed mail also ends in permerror instead of fail, because the -all at the end is not reached.

What exactly RFC 7208 counts

Section 4.6.4 of RFC 7208 splits the terms of an SPF record into two groups. Six terms cause DNS lookups during evaluation: the include, a, mx, ptr and exists mechanisms and the redirect modifier (RFC 7208). Their total is limited to ten (RFC 7208). The remaining terms, namely all, ip4, ip6 and the exp modifier, do not query anything during evaluation and are not subject to the limit (RFC 7208).

TermCounts toward the limitWhat is queried
include:nameyes, plus everything in the included recordthe SPF record of the included name
redirect=nameyes, plus everything in the target recordthe SPF record of the target, only if no mechanism matches
a, a:nameyesthe addresses of the name
mx, mx:nameyesthe mail servers of the name and their addresses
exists:nameyeswhether the name has an address
ptryesthe reverse lookup of the sending server's IP address; the standard says not to use it
ip4, ip6nonothing, the address is in the record
allnonothing
exp=namenoonly after evaluation, for the text of a rejection

Two further limits sit in the same section and are easily overlooked. Each mx mechanism may additionally trigger no more than ten address lookups (RFC 7208). A domain with many mail servers can therefore fail at the mx even though the overall counter still has room. And lookups that come back empty or point to a nonexistent name should be limited to two by verifiers (RFC 7208). The standard calls them void lookups; producing more of them also results in a permerror (RFC 7208).

Finally, the standard recommends that receivers set a time limit for the whole evaluation that allows at least 20 seconds (RFC 7208). If it is exceeded, the result is usually temperror, a temporary error (RFC 7208). A large tree with slow name servers can therefore cause trouble even below ten lookups, but intermittently.

How nested includes fill up the counter

The graphic above shows an invented domain shop.example with three sending services: mailbox service, newsletter service and ticket system. Its own record is short; only the included records show what is actually queried:

shop.example – SPF tree (TXT)
shop.example.      TXT "v=spf1 include:mail.example include:news.example include:help.example -all"

mail.example.      TXT "v=spf1 include:a.mail.example include:b.mail.example include:c.mail.example -all"
news.example.      TXT "v=spf1 include:eu.news.example a:out.news.example -all"
help.example.      TXT "v=spf1 include:eu.help.example include:us.help.example include:new.help.example -all"

; the third-level records contain only ip4, ip6 and all

Counting follows the order of evaluation. include:mail.example is lookup 1, the three records inside it are lookups 2 to 4. include:news.example is lookup 5, the include and the a inside it are 6 and 7. include:help.example is lookup 8, followed by 9, 10 and 11 inside it. Three references in your own record thus add up to eleven lookups. The eleventh exceeds the limit, and evaluation ends in permerror, even though every single record is correct on its own.

In the example, the deciding factor is new.help.example, a record the ticket system added on its side, for example for a new location. Until then, the domain was at ten lookups and therefore exactly at the limit that is still allowed. Your own TXT record stayed unchanged; a check that reads only that record finds nothing. The mail affected is precisely the mail from the new location, because it only matches in the last record.

Ten is allowed, eleven is not

The standard limits the total to ten (RFC 7208). A domain with exactly ten lookups passes but has no buffer: the next change at a service tips it over.

Why the tree changes without you doing anything

An include deliberately hands over maintenance: the sending service is meant to be able to change its address ranges without every customer adjusting their record. The standard explicitly describes the mechanism as a way to cross administrative boundaries (RFC 7208). The downside is that you no longer control the number of lookups on your own.

Typical triggers on the service side are new data centers, splitting a large record into several smaller ones, or moving to new names. On your side comes the most common trigger: one more service, at year end typically for holiday greetings or year-end mailings. Anyone who then counts only the one include of the new service misses what hangs behind it.

Why services split their records has to do with size. A single text string in a TXT record may be at most 255 octets long; longer records are assembled from several strings (RFC 7208). The standard also recommends that the answer to the SPF query fit within 512 octets (RFC 7208), so that it arrives over UDP without falling back to TCP. Many address ranges therefore end up in several sub-records, and each costs the customer one lookup.

Warning: Comparing your own zone stays silent

When a service changes its record, a TXT record changes in its zone, not in yours. A comparison of your own DNS records with the previous state therefore shows no difference. On top of that, resolvers keep handing out the old answer until it expires; how differently that can look from resolver to resolver is described in the article on DNS propagation and multi-resolver monitoring. The change only becomes visible when someone recounts the whole tree.

redirect: the second way into the counter

Besides include, the redirect modifier also leads into another record. It is meant for organizations that serve several of their own domains from a shared record: redirect=_spf.shop.example takes over the authorizations and policy of the target. It is only evaluated if no mechanism in the record matches (RFC 7208), and it is ignored as soon as there is an all anywhere in the record (RFC 7208).

For the counter, the same applies as for include: the reference itself costs one lookup, everything in the target counts too, and the target may in turn redirect to yet another target (RFC 7208). One difference lies in the result. If no SPF record is found at the target, the result is permerror rather than none (RFC 7208). Three cases come up frequently in practice:

  • redirect at the end of the record: is only reached if nothing before it matched. For spoofed mail that is the normal case, which is why the target belongs in every count.
  • redirect next to all: is ignored. A record like v=spf1 redirect=_spf.shop.example -all therefore acts like v=spf1 -all and makes every sender fail SPF, including your own servers.
  • redirect to an external domain: is considered unreliable by the standard; include is generally the more appropriate route here (RFC 7208).

An include pointing to a name without an SPF record

The second common reason for a record that fails without any change on your part is a reference into nothing. If the recursive evaluation of an include returns none because there is no SPF record at the included name, the include turns that into a permerror (RFC 7208). The same applies if there is more than one record starting with v=spf1 at that name: multiple records at one name also result in permerror (RFC 7208).

Typical causes are a typo in the name, a service that moved its records to a new name and removed the old one, or a canceled service whose reference is still in the record. The last case is treacherous: if the service removes the old name months later, your record fails because of a line nobody was watching anymore.

More than ten lookups

The tree of include, a, mx, ptr, exists and redirect exceeds the limit of ten (RFC 7208). Result: permerror for all mail whose evaluation runs that far.

Reference without an SPF record

An include or redirect points to a name without a valid record, often after a service moved or was canceled. Result: permerror.

Two records with v=spf1

A second SPF record for the remaining services looks like a quick fix. Multiple records at one name, however, also result in permerror (RFC 7208).

Empty answers

a, mx or exists pointing to names that no longer exist. For such void lookups the standard recommends a limit of two; the third leads to permerror (RFC 7208).

What a permerror triggers at the receiver

How a receiver handles a permerror is not fixed by the standard. It explicitly leaves the choice to the receiving side, meaning those who implement or operate the check (RFC 7208), and describes two routes: rejecting the mail to draw attention to the problem, or delivering it and merely noting the problem. If a server rejects the mail during delivery, it should use reply code 550 and, where supported, the enhanced status code 5.5.2 (RFC 7208).

More often, the error takes effect through DMARC. A DMARC result of pass requires that SPF or DKIM passed and that the checked domain is aligned with the visible sender domain (RFC 9989). An SPF permerror is not a pass. If the mail carries an aligned DKIM signature, DMARC can still pass; if not, DMARC fails and your domain's policy applies. Which policy then takes effect and what RFC 9989 changed about it is covered in the article on DMARC under RFC 9989.

For sending to large mailbox providers, there is more: since February 1, 2024, Google has required all senders who send to Gmail accounts to set up SPF or DKIM (Google). Anyone sending more than 5,000 messages per day to Gmail accounts needs SPF and DKIM plus DMARC (Google). A record that ends in permerror exists, but it does not deliver a passing SPF result. The other rules for bulk sending are summarized in email delivery 2026.

The error becomes visible in two places. In the Authentication-Results header of a received message, the result appears under the method name spf (RFC 8601), for example as spf=permerror. And in DMARC aggregate reports, each source carries its SPF result, whose valid values include permerror (RFC 9990). How to read them is shown in analyzing DMARC reports. If a confirmation email fails this way, monitoring double opt-in helps.

Consolidating instead of exceeding: the trade-offs

If the counter is at ten or above, several routes lead back below the limit. None of them is free, and the most convenient one often creates the next problem:

MeasureSaves lookupsCost and risk
Remove unused servicesall lookups in the service's treenone, if the service really no longer sends; check the DMARC reports first
Replace your own a and mx with ip4 and ip6one per mechanismaddresses of your own servers have to be updated with every move
Remove ptronenone, the standard advises against it anyway
Move a sending service to its own subdomainthe service's whole tree in the main recordthe subdomain needs its own SPF record and matching DKIM
Resolve the services' records into fixed address listsalmost allchanges at the services no longer arrive, the record silently goes stale and grows long

According to the standard, the ptr mechanism should not be published at all (RFC 7208); if it is still in a record, it is the easiest candidate. Often the most effective step is separating by envelope address. SPF checks the domain from the envelope of the mail, and for DMARC only this MAIL FROM identity counts (RFC 9990). If a newsletter service puts its envelope address on a subdomain of its own such as news.shop.example, a separate SPF record with its own counter is evaluated there, and the main record becomes shorter by that service's entire tree. For DMARC, relaxed alignment is then sufficient, where the subdomain and the sender domain share the same organizational domain (RFC 9989). It is the default; if your DMARC record sets aspf=s, it requires strict alignment, meaning an identical domain (RFC 9989), and the subdomain no longer matches.

Resolving every include into fixed address lists, often called flattening, reduces the counter the most. But it reverses the purpose of include: maintenance is back with you, and if a service changes its addresses, from that day on it sends from servers your record does not know. The record also becomes long, and the more address ranges it carries, the sooner the answer exceeds the recommended 512 octets (RFC 7208). Without regular comparison with the services' records, this trades a visible error for a silent one.

Warning: Do not create a second SPF record

An obvious but wrong way out is a second TXT record with v=spf1 for the remaining services. More than one SPF record at one name results in permerror (RFC 7208), so the damage would be the same. All services belong in one record or on their own subdomains.

Recounting the tree yourself

Before making a change, you can walk the tree manually with dig. This also shows which service costs how much. In the example, the path to the eleventh record looks like this:

$ dig +short TXT shop.example
"v=spf1 include:mail.example include:news.example include:help.example -all"
$ dig +short TXT help.example
"v=spf1 include:eu.help.example include:us.help.example include:new.help.example -all"
$ dig +short TXT new.help.example
"v=spf1 ip4:192.0.2.0/24 ip6:2001:db8:40::/48 -all"
  1. Read your own record: note every include, a, mx, ptr and exists, and a redirect only if there is no all in the record.
  2. Follow every reference: fetch the included record and count the same way there, until only ip4, ip6 and all remain.
  3. Note empty answers: a name without an SPF record or without an answer is a finding in its own right, not a zero.
  4. Add it up: the sum across all levels counts. If it is ten, there is no buffer left.
  5. Record the date: the number only applies to the day of measurement, because the services keep changing their records.

The catch: counting by hand is a snapshot, and the problem arises precisely between two snapshots. The free mail check follows the same counting path at the push of a button; DNS monitoring repeats it continuously.

What XICTRAQ® counts and where counting stops

XICTRAQ® checks your website's DNS records every six hours on paid plans and every 24 hours on the Free plan (XICTRAQ feature page). On each of these checks, the agent counts the lookups of the SPF record: include, a, mx, ptr, exists and redirect, including all nested records. If the record needs more than ten lookups or an include or redirect points to a name without a valid SPF record, XICTRAQ® rates it as ineffective and names the cause (XICTRAQ documentation). In the email authentication view, SPF is then shown as “Weak”, with a note on the lookups or the faulty reference.

The same counting path is built into the scan and the free mail check. There the number is shown explicitly, for example as “DNS lookups: 7 of at most 10”; if not every included record could be read, “at least” appears in front of it. How the check rates the details is described in the DNS and email documentation. This counting has limits you should know about:

  • No dedicated alert for exceeding the limit. For email authentication, an alert goes out through your channels only if none of SPF, DKIM or DMARC is found (XICTRAQ documentation). An SPF record that is too large appears as a finding in the view; there is no warning when approaching the limit.
  • A fixed budget per check. The agent reads nested records only up to a fixed number of lookups and for no longer than 20 seconds, the minimum the standard recommends to receivers (RFC 7208). If a name does not respond, a macro sits in the target or the budget is used up, the counted number is a lower bound.
  • Empty answers are not counted. The limit of two void lookups (RFC 7208) is not part of the check, nor are the additional address lookups per mx.
  • The whole tree is counted. XICTRAQ® counts as if no earlier mechanism matched, which is the path of a spoofed message. Mail from services listed early may still pass.
  • Changes to your own TXT record appear in the changelog with old and new value. Changes in the services' zones do not; only the count shows the new state.

What else the module monitors, from DNSSEC to domain expiry, is described on the DNS and domain monitoring page. If you want to see the view with sample data first, you will find it in the live demo.

Count once before the next sending service

The limit of ten lookups (RFC 7208) is not an edge case for large corporations; three sending services with two or three sub-records each are enough. So the right question is not whether your record fits today, but how much buffer it has and who notices when it is used up.

  • Before adding a new service, count the whole tree, not just the one include.
  • Remove canceled services from the record as soon as their last mail has gone out.
  • No ptr, no second SPF record and no redirect next to all.
  • Move sending services with their own envelope address to a subdomain where the service supports it.
  • Have the count repeated continuously instead of once a year.

If you are taking stock at year end, include the SPF record. An error that cost mail during holiday sales belongs in the same review as the postmortem after Black Week. Which plan fits your number of domains is shown on the pricing page; after registering, the check starts with the first website you add.

Note: Sources and standards

This article is based on: RFC 7208, Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1 (April 2014), in particular section 4.6.4; RFC 9989, Domain-Based Message Authentication, Reporting, and Conformance (DMARC), May 2026; RFC 9990, DMARC Aggregate Reporting, May 2026; RFC 8601, Message Header Field for Indicating Message Authentication Status, May 2019; Google, email sender guidelines for Gmail accounts (help article 81126). Information on XICTRAQ® is based on the feature page and documentation as of November 2026. The domains in the example are invented and use the reserved .example top-level domain.

Why is my SPF record invalid even though I did not change anything?
Usually an included record has changed. Every include takes on the lookups of the service, and the limit of ten applies to the entire evaluation including all nested records (RFC 7208). If a service adds a sub-record, your counter rises without anything changing in your zone.
Do ip4 and ip6 count toward the limit of ten lookups?
No. ip4, ip6, all and exp do not cause a lookup during evaluation and are not subject to the limit (RFC 7208). What counts is include, a, mx, ptr, exists and redirect, including nested records.
What happens from the eleventh DNS lookup?
The check must return permerror (RFC 7208). Whether the receiver then rejects or delivers the mail is its own decision. For DMARC, a permerror does not count as a passing SPF result; if DKIM does not pass in alignment with the sender domain either, DMARC usually fails.
Is an include pointing to a name without an SPF record harmless?
Typically not. If evaluation finds no SPF record at the included name, the result none becomes a permerror (RFC 7208). Common causes are typos and services that removed their old name after a move or a cancellation.
Does it help to resolve the includes into fixed IP addresses?
It lowers the counter but shifts maintenance to you. If the service changes its addresses, it sends from servers your record does not know. The record also becomes long, and the standard recommends that the answer fit within 512 octets (RFC 7208). A dedicated subdomain for the service is usually the better choice.
Does XICTRAQ® warn when the SPF record exceeds the limit?
XICTRAQ® counts the lookups on every DNS check and shows SPF as “Weak” with the cause when there are more than ten lookups or a faulty reference (XICTRAQ documentation). There is currently no dedicated alert for exceeding the limit, and no warning when approaching it either. The free mail check shows the counted number.

Related in XICTRAQ®

First scan usually in under a minute

Let XICTRAQ® watch your website.

Free plan with no fixed term available. No credit card, no installation, no hidden fees.