DNSBuddy
  • Tools
  • Data
DocsDocumentationKBKnowledge Base

Documentation

Documentation

Help center guides

Getting started
  • Welcome
  • How to Check DNS Propagation: A Developer's Guide
  • How to Set Up an SPF Record: Step-by-Step Guide
  • DNS Security Best Practices
  • DNS Migration Checklist for Production Teams
  • Reverse DNS Lookup: Check PTR and FCrDNS
  • RDAP vs WHOIS: Which Protocol to Query in 2026
  • SPF Lookup Limit: Count Includes Before PermError
  • DNSSEC SERVFAIL: Check DS, DNSKEY, and RRSIG

SPF Lookup Limit: Count Includes Before PermError

SPF allows 10 DNS lookups. On 22 November 2026, github.com was at 10 and google.com was at 1. Count the chain before you add a sender.

On this page

  • What counts as a lookup
  • PermError is not a failed match
  • google.com is one lookup
  • github.com is sitting on the cap
  • Count your record
  • Get back under 10
  • The other PermError
  • Frequently asked questions

SPF Lookup Limit: Count Includes Before PermError

TL;DR SPF evaluation may perform at most 10 DNS lookups. The 11th is a PermError. include, a, mx, ptr, exists, and redirect each count as one. ip4, ip6, and all do not. Nested includes count. On 22 November 2026, google.com used 1 lookup and github.com used 10.

Last updated: November 22, 2026

You will leave with a count for your own record, not a slogan about flattening. The SPF Analyzer reports that count as lookup_count after it walks the include tree. The rules below are RFC 7208 section 4.6.4.

If you are publishing a record for the first time, start with how to set up an SPF record. This page is only the cap.

What counts as a lookup

The limit is on mechanisms that cause a DNS query during evaluation. It is not a count of packets, and it does not include the TXT query that fetched your own SPF record.

TermCounts toward 10?
include:Yes. One, plus every counting term inside the included record
redirect=Yes. One, plus the counting terms in the target record
aYes. One, even when the lookup returns both A and AAAA
mxYes. One, even when each MX host is then resolved to addresses
ptrYes. One
exists:Yes. One, including a macro such as exists:%{i}._spf.example.com
ip4: / ip6:No
all (-all, ~all, ?all, +all)No
exp=No. That lookup happens only after the result is already a failure

A record that is already at 10 is legal. One more counting term is a PermError, and receivers treat that as a permanent error, not as a soft fail.

The Analyzer follows the same rule. An a mechanism increments lookup_count by 1, which matches the tests on the expander. The A and AAAA queries it makes to collect addresses are not extra points on the cap.

PermError is not a failed match

SPF has several results. Only one of them means "this record cannot be evaluated."

ResultMeaning
passThe sending IP is in the evaluated set
failThe IP is not in the set, and the record ends in -all
softfailThe IP is not in the set, and the record ends in ~all
neutralThe record ends in ?all, or has no all
temperrorDNS failed temporarily while evaluating. Try again
permerrorThe record is invalid or over a hard limit. Retrying will not help

A sender that is simply missing from the record gets fail or softfail. A sender that is authorized, on a record with 11 counting terms, gets permerror along with everyone else. Mail from the right servers fails evaluation because the record itself is broken. That is the outage people notice as "we added a vendor and mail from the old vendors started failing too."

github.com on 22 November 2026 was one include away from that. The eight providers on the TXT line are not eight lookups. Two of those providers spend a second lookup, and the total is already 10.

google.com is one lookup

Queried on 22 November 2026:

google.com.           TXT  "v=spf1 include:_spf.google.com ~all"
_spf.google.com.      TXT  "v=spf1 ip4:74.125.0.0/16 ip4:192.178.47.0/24 … ip6:… ~all"

The only counting term is include:_spf.google.com. The included record is ip4 and ip6 ranges. Those do not count. The total is 1.

_netblocks.google.com and _netblocks2.google.com are still published, and other domains still include: them. google.com itself no longer goes through that chain. A guide that still says Google costs three or four lookups is describing an older record. A domain that still publishes include:_netblocks.google.com pays one lookup for a record that is only ip4 ranges. That include is on the GitHub record below.

github.com is sitting on the cap

The same day, github.com published this record (TXT strings joined):

v=spf1 ip4:192.30.252.0/22
  include:spf.protection.outlook.com
  include:_netblocks.google.com
  include:_netblocks2.google.com
  include:mail.zendesk.com
  include:_spf.salesforce.com
  include:servers.mcsv.net
  include:mktomail.com
  include:sendgrid.net
  ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131
  ~all

Eight includes are eight lookups. The ip4 mechanisms and ~all add nothing. The included records, queried the same day:

Included recordCounting terms inside it
spf.protection.outlook.comNone. ip4 and ip6 only
_netblocks.google.comNone. ip4 only
_netblocks2.google.comNone. ip6 only
mail.zendesk.comNone. ip4 only
_spf.salesforce.comexists:%{i}._spf.mta.salesforce.com counts as 1
servers.mcsv.netNone. ip4 only
mktomail.comNone. ip4 only
sendgrid.netinclude:ab.sendgrid.net counts as 1. That target is ip4 only

8 + 1 + 1 = 10. One more include: on github.com, or one new counting term inside SendGrid or Salesforce, and the record is over the limit. This is why a flat list of eight providers can still be a full budget: two of them spend a second lookup.

Paste the domain into the SPF Analyzer and read lookup_count. For this record the number to expect is 10, not 8.

Count your record

  1. Publish or draft a single TXT record that starts with v=spf1. Two records that both start with v=spf1 are already a PermError, before the lookup cap comes into it. The SPF record reference covers the mechanisms.
  2. Open the SPF Analyzer or the SPF checker and expand the domain.
  3. Read lookup_count. Treat 8 and 9 as full. Treat 10 as no room for another sender that uses include, a, mx, exists, ptr, or redirect.
  4. Open any child in the tree whose own record is not a list of ip4 and ip6. That child is where the extra points hide. SendGrid's extra include: is the one in the GitHub tree.
  5. Count again when a provider changes their record, not only when you edit yours. The line in your zone can stay the same while lookup_count goes from 9 to 11.

A provider's setup page that says "add include:spf.example.com" is describing their record today. If they later add an a or another include, your count goes up and you will not see it in your own TXT line.

Get back under 10

Replace a counting term with addresses when the included record is already a list of ranges. That is what google.com did: _spf.google.com is the ranges, and the domain pays for one include instead of a nest of _netblocks names.

Do this only for a provider whose ranges you are willing to re-check. An ip4 copy does not follow the provider when they add a new block. An include does. Flattening a record that changes every month trades a PermError for a silent miss.

mx and a on your own domain are the usual waste. If the mail servers already have stable addresses, ip4 and ip6 authorize them without spending a lookup. Keep include for providers that tell you to, and spend it on those.

ptr counts as one and is a poor authorization mechanism. RFC 7208 discourages it. Removing it both saves a lookup and drops a mechanism receivers do not want.

The other PermError

Section 4.6.4 also caps void lookups at two. A void lookup is a DNS query during evaluation that returns no records or NXDOMAIN. A third one is a PermError even when lookup_count is under 10.

The Analyzer does not report that second cap. lookup_count is the 10-mechanism limit only. If a receiver still says PermError and the Analyzer says 6, check for includes that no longer exist.

Frequently asked questions

Does the TXT lookup of my own domain count toward the 10?
No. The limit starts with the mechanisms in that record. include, a, mx, ptr, exists, and redirect count. The query that fetched the record does not.
Does an include of a record that is only ip4 ranges count?
The include itself counts as one. The ip4 and ip6 mechanisms inside it do not. google.com is one lookup for that reason: include:_spf.google.com, and the included record is ranges.
Is 10 already a PermError?
No. The specification requires a PermError when the number of DNS-querying terms exceeds 10. A record at 10 is valid and has no room for another include, a, mx, ptr, exists, or redirect.
Why did the count jump when I only added one include?
The included record has its own counting terms. On 22 November 2026, include:sendgrid.net on github.com cost two: the include, and include:ab.sendgrid.net inside SendGrid's record.
RFC 7208

Sender Policy Framework (SPF) for Authorizing Use of Domains in Email