Updated November 2026

How to check SPF 10-lookup limits across 50 client domains

An SPF record that passes every syntax checker can still fail every delivery. The limit is not syntax, it is ten DNS lookups, counted through every include a marketing tool has quietly added over four years.

SPF still works the way it did in 2014: publish a TXT record beginning with v=spf1, list the mechanisms that may send mail for the domain, end with an all qualifier. What changed is the number of third parties an average business uses. Google, Microsoft, Mailchimp, Klaviyo, Zendesk, HubSpot, a website contact form, a booking widget, and a legacy ESP nobody remembers signing up for.

Each of them contributes an include: and each include consumes part of a fixed budget that RFC 7208 sets at ten DNS lookups.

The rules that matter

  • A maximum of 10 DNS-querying terms per SPF evaluation: include, a, mx, ptr, exists and redirect.
  • Nested includes count too. An include that itself contains five includes costs six.
  • A maximum of two void lookups (a query that returns no answer).
  • More than one v=spf1 record on the same name is a permanent error, not a merge.
  • Crossing the limit returns permerror, and most receivers then treat the domain as having no SPF at all.

Why syntax checkers say the record is fine

A syntax checker validates the grammar of one string. It sees include:_spf.google.com and reports a valid mechanism. It does not follow the include, count what is inside it, and follow those includes in turn. The failure only appears when you evaluate the record the way a receiving mail server does.

The practical consequence: a client changes nothing, a vendor adds an include, and eight months later their invoices start landing in spam with no error message anywhere. Nobody edits a record to break it. It degrades.

Counting by hand

A quick walk for one domain, using dig:

dig +short TXT acme.com | grep v=spf1
"v=spf1 include:_spf.google.com
 include:servers.mcsv.net
 include:spf.protection.outlook.com
 include:mail.zendesk.com
 include:sendgrid.net ~all"

dig +short TXT _spf.google.com

Each of those five includes costs at least one lookup. If any of them nests further (Microsoft and Mailchimp both do), the count climbs. Five includes can easily evaluate to nine or eleven lookups. Above ten, the record is dead on arrival.

Doing it across fifty domains

The spreadsheet version

Pull each domain's TXT record, open every include by hand, count nested includes, and repeat monthly. At ten minutes per domain it is eight hours, and it decays immediately, because the only domains you will re-check are the ones you remember.

The automated version

A recursive counter does the same walk in code: fetch the record, parse mechanisms, recurse through includes, a, mx, ptr, exists and redirect, sum the queries, and stop at a depth limit instead of looping on a malformed record. Cache nothing across domains, because includes are shared and a vendor change affects fifty clients at once.

Run it every six hours and the interesting output is not the current number, it is the change. A record that moves from 8 to 11 is a client about to lose email, and you can call them before they notice. That is the difference between monitoring and reporting an incident.

What to do when a record is over

  1. 1Ask which vendors still send mail. Most portfolios have at least one dead include.
  2. 2Remove the dead include first. That is usually enough, and it needs no vendor support ticket.
  3. 3If two vendors share an infrastructure provider, use the provider's flattened record once instead of two includes.
  4. 4Move rarely used senders behind a subdomain with its own SPF record, so the apex stays under the limit.
  5. 5Never fix a limit breach with -all. Fix the count, then tighten the qualifier.

Report it, do not just alert it

An SPF lookup count is one of the six lines worth putting in a client report. It converts a technical number into a visible piece of maintenance: "8 of 10 lookups used, no action needed". When it becomes 11, the client has already seen the number before, which makes the conversation about a fix rather than about whether the care plan does anything.

You can scan five client domains without an account and see the counts, or read the report template to see how the line reads.