SPF (Sender Policy Framework) is the DNS record that lists which servers may send email for a domain. It has a rule many people never hear about until mail starts going to spam: evaluating the record may take at most 10 DNS lookups. Go over, and the result is a permanent error (permerror). Most receivers treat that as an SPF failure, for every message.
What counts as a lookup
The limit comes from RFC 7208, section 4.6.4. These terms each cost one lookup:
include:aandmxptr(deprecated, avoid it)exists:- the
redirect=modifier
ip4:, ip6: and all are free. The catch is that the count is recursive: every include: points at another SPF record, and every lookup inside that record counts towards your 10 too.
How a normal small business ends up over the limit
A typical record grows one tool at a time:
v=spf1 include:spf.protection.outlook.com include:_spf.salesforce.com include:servers.mcsv.net include:sendgrid.net include:mail.zendesk.com ~allThat looks like five lookups. But several of those providers' records contain their own includes, so the real total can be well above five, and the next tool someone adds (a booking system, a billing platform, a marketing automation tool) tips it over 10. Nothing warns anyone when it happens. Email just starts failing authentication.
Providers change their records over time, so the only reliable number is the one you count today. Our free SPF lookup counter follows every include and shows the total.
Other SPF mistakes that look harmless
- Two SPF records. A domain must have exactly one TXT record starting with
v=spf1. Two records make SPF fail, even if each one is correct on its own. +allallows every server on the internet to send as the domain. It cancels SPF completely.?all(neutral) tells receivers not to treat unknown senders as suspicious.- No
allat the end. The record does not say what to do with anything else.
How to fix a record that is over the limit
- Inventory real senders. Which tools actually send mail as this domain today? Old trials and retired tools are the easiest lookups to remove.
- Move bulk senders to a subdomain. Newsletters can usually send from
news.example.comwith their own SPF record. This is often the cleanest fix. - Prefer DKIM where the tool supports it. DMARC passes if either SPF or DKIM passes and aligns. A tool that signs with DKIM on your domain does not strictly need to be in SPF.
- Flatten carefully, if you must. Replacing includes with the IP ranges they resolve to removes lookups, but those ranges change. Only flatten with a process (or a service) that keeps the list updated.
- Re-count after every change, and keep the record under about 8 lookups to leave room for the next tool.
Why it matters more since 2024
Gmail, Yahoo and Microsoft now require authenticated mail from anyone sending in volume, and they treat authentication failures far more harshly than before. An SPF record that quietly broke last year is now a deliverability problem. See Google, Yahoo and Microsoft sender rules, explained.
Keep reading
Google Yahoo sender requirements · 6 min read
Google, Yahoo and Microsoft sender rules, explained for small business owners
The authentication rules the big mailbox providers now enforce, translated into a short checklist for small businesses.
DMARC p=none vs reject · 5 min read
DMARC p=none vs quarantine vs reject, in plain English
What each DMARC policy does to fake email, and a safe path from p=none to p=reject.
MSP DMARC prospecting · 7 min read
How MSPs use DMARC gaps to book first meetings (with templates)
Find prospects with missing or weak DMARC, explain the risk in one sentence, and ask for 15 minutes. Templates included.