The SPF 10-lookup limit
An SPF record stops working when checking it requires more than ten DNS lookups. The record still sits in DNS and reads correctly. The check fails anyway, and the mail affected is the client's ordinary business mail. Agencies and MSPs meet this failure most often a few days after a client adds a new sending service.
How the count grows
Checking an SPF record means following the record's instructions. Several mechanisms in a record send the receiving server off to fetch another record: include, a, mx, ptr, and exists, along with any record reached through a redirect modifier. Each fetch counts as one lookup, and the fetched record can contain instructions that trigger further lookups of its own.
Large sending platforms account for most of the growth. One include for a platform can add two or three lookups, because the platform's own record includes records from its regional services. A client domain with three sending services might sit at six lookups. Two more services take the count past ten, with no change in how much mail the client sends.
What happens past ten lookups
The receiving server stops the check at the limit and returns a permanent error, recorded as permerror. SPF then produces no pass result for the message. DMARC can still pass on DKIM alignment alone. A message from a service that aligns only through SPF fails DMARC from that point on, and it is treated under the domain's DMARC policy, which can mean the spam folder or outright refusal at p=reject.
The breakage looks random from the client's side. Mail from the mailbox platform keeps flowing, because that service signs with DKIM. Mail from the invoicing system starts landing in spam, because that service relied on SPF. Both services send from the same domain, and the difference sits in one record.
How to count the lookups in a record
Start with the domain's own SPF record and count each mechanism that triggers a lookup. Then open every included record and count again inside it. Continue until no record points anywhere further. The total is the count a receiving server works through.
Count again after every change. A client adding a service changes the count directly. A vendor changing its own record changes the count without any edit on the client's side, because the vendor's includes sit inside the client's total. A record counted at nine lookups in January can pass ten later in the year after a vendor update. Domains that sit at eight or nine lookups deserve a recount on a schedule, for example at each quarterly review.
What to do when the count is close to the limit
Four remedies cover most cases:
- Remove includes for services the client no longer uses. Trial platforms and old marketing tools stay in records for years after the contract ends.
- Move a sending service to a subdomain. Mail sent from a subdomain is checked against the subdomain's own SPF record, with its own allowance of ten lookups.
- Ask the vendor for a shorter arrangement. Some vendors offer a dedicated sending subdomain or a record with fewer nested includes, and the option rarely appears in their standard setup instructions.
- Rewrite the record as a flat list of IP addresses. A flat record uses no lookups. The list goes out of date when a vendor changes its sending addresses, so someone has to refresh the record on a schedule for as long as it stays flat.
When TSU Company prepares an SPF record for a client domain, we arrange the record so the lookup count stays within ten, and the count is checked again whenever a sender is added or changed.
Check a client domain
A free check of one domain at tsucompany.net/domain-check shows whether an SPF record is present and whether a DMARC record exists. The domain you enter is not stored. For the state of a whole client list, the free check covers up to 50 domains and returns a PDF under your company's name within three business days, with a score and the next step for each domain.