Skip to main content
osky
Sección
Email

The ten DNS lookup limit in SPF is one of those rules everybody knows and almost nobody follows, because "it gets delivered in Gmail." Now there's data on where it actually breaks in practice. A team from DMARKOFF and GlockApps sent email with increasingly long SPF records to real mailboxes, and the result is uncomfortable: Gmail and Yahoo accepted up to 17 lookups and rejected 22, while Outlook.com, Hotmail and Apple iCloud rejected everything beyond 10. If your domain sends invoices, codes or notifications to people with a Hotmail or iCloud account, a record that "works in Gmail" may be dropping your email right there.

What the standard says

The rule is in section 4.6.4 of RFC 7208. The terms that require a DNS query are the include, a, mx, ptr and exists mechanisms, plus the redirect modifier. The implementation "MUST limit the total number of those terms to 10" and, if it goes over, it must return permerror. ip4, ip6, all and exp, on the other hand, don't count.

There are two details that tend to be forgotten:

  • The count is total, not per level. Each include opens the provider's record, and whatever that record queries also adds up. That's why a single include can cost more than one lookup: in the test, include:_spf.mailgun.org added two.
  • Empty lookups also have a cap. The RFC recommends allowing at most two "void lookups" (lookups that return empty or NXDOMAIN) and returning permerror on the third.

The test: 21 providers and a deliberately broken record

In October 2026, DMARKOFF published 13 SPF configurations, each on its own subdomain, and sent about 3,800 messages to GlockApps seed mailboxes at 21 providers and five antispam filters. All the subdomains had DMARC with p=reject and, except for the controls, no message carried aligned DKIM: the verdict depended on SPF alone. A note on context: DMARKOFF sells DMARC monitoring tools and GlockApps is from the same team. They say so themselves and they published the data on GitHub.

With 11 includes before the sender (13 lookups when going through Mailgun), Gmail, Google Workspace, Yahoo, AOL and AT&T gave spf=pass and accepted the email. Microsoft rejected it with 5.7.509, and Apple, GMX, WEB.DE, Yandex, Mail.ru, La Poste, Onet and Interia bounced it too. Libero, Virgilio and Proton sent it to spam.

On October 29 they ran another round to measure how far Google's and Yahoo's tolerance goes, with the includes either in a row or nested one inside another:

Table with the results of the DMARKOFF test: Gmail and Yahoo accept 12, 13 and 17 lookups and reject 22 and 27; Outlook.com and Apple only accept 7

  • 12, 13 and 17 lookups: accepted by Gmail, Workspace and the Yahoo family; rejected by Outlook.com, Hotmail and Apple.
  • 22 and 27 lookups: rejected by everyone. Google responded 5.7.26 and Yahoo, AOL and AT&T 5.7.9.
  • Nesting changes nothing: a chain 15 levels deep (17 lookups) passed and one 20 levels deep (22) didn't. The total counts, not the depth.
  • Record length doesn't matter: one of 732 characters that stayed within the limit passed everywhere.

Google's and Yahoo's cutoff landed somewhere between 18 and 22 lookups; they didn't narrow it down any further. Al Iverson, from Spam Resource, who shared the test on November 23, had already said that in his experience Gmail lets 11 through. His summary: just because some providers turn a blind eye doesn't mean you should count on it.

Why your broken record "does work"

The most useful finding of the study isn't the number, it's this: the same record with the 11 includes placed after the sender passed everywhere. SPF evaluates left to right and stops at the first match. If your main server is at the start, it never reaches the limit and everything looks fine in your tests. Whoever lands after the cutoff, say the newsletter platform or the CRM you added last, fails quietly at Microsoft and Apple.

My take: that's how bloated records survive for years. Nobody complains because the important email goes out, and the one that bounces is from a provider nobody checks.

Empty lookups barely had an impact: with three, only Onet and the Barracuda filter rejected the message. Even so, DMARKOFF points out that the typical cause is a: and mx: entries for servers that no longer exist, and those get deleted in two minutes.

How to count your lookups

I didn't test this against real mailboxes; this comes from the RFC and the study. With dig you can count them by hand:

dig +short TXT tudominio.com
dig +short TXT _spf.proveedor.com
  1. Pull your record and add 1 for each include, a, mx, ptr, exists and redirect.
  2. For each include, open the record it points to and repeat the count inside it, until you reach records that only have ip4, ip6 and all.
  3. If the total goes over 10, you're already broken for Outlook and Apple, even if Gmail says pass.
  4. Check the order: whatever comes after the tenth term is what will fail first.

Online SPF validators do this math for you, and DMARKOFF flags it as "lookup 11 of 10" in its own tool.

What to do if you're over

This is opinion and common practice, not something the study measured:

  • Remove what you no longer use. Providers you left years ago, a: and mx: entries for switched-off servers, ptr (the RFC says not to publish it).
  • Swap a and mx for ip4/ip6 when they're your own servers with a fixed IP. They cost zero lookups.
  • Split by subdomain. If your newsletter tool lets you use its own bounce domain or a subdomain of yours, that subdomain carries its own SPF and stops consuming lookups from the main domain.
  • Be careful with "flattening" the record (replacing the includes with the provider's IPs): if the provider changes its ranges and you don't find out, you break your SPF without touching it.
  • Sign with aligned DKIM. The study deliberately forced DMARC to depend on SPF alone; with aligned DKIM, an SPF stumble doesn't take down your DMARC by itself.

Aliaksandr Markau, co-founder of GlockApps, wrapped it up like this in his post: keep SPF within 10 and treat Google's and Yahoo's tolerance as a cushion, because "Microsoft and Apple gave me no such margin".

Sources