The rule
A receiver checking SPF may make at most ten DNS lookups for one message (RFC 7208, section 4.6.4). If your record needs more, the receiver stops and the result is a permanent error (permerror), for every message, including the ones you really sent.
A permanent error is not a pass. DMARC needs SPF or DKIM to pass for your domain, so a domain that relies on SPF can fail DMARC because of this limit alone.
What counts, and what does not
Each include, a, mx, ptr and exists mechanism, and the redirect modifier, costs one lookup. So does every one of those terms inside the records you include, and inside the records they include in turn: the limit covers the whole chain, not just your own record.
ip4, ip6 and all cost nothing, because the receiver needs no DNS query for them. The exp modifier does not count either.
Two further limits apply. Each mx term may lead to at most ten mail server names to look up, or it is a permanent error. And lookups that find nothing (a name that does not exist, or one with no records of the type asked for) are called void lookups: receivers should allow at most two, and a third is again a permanent error.
How include and redirect behave
include does not copy the other record into yours. The receiver evaluates the included record on its own and only asks whether it matched the sending server. A -all inside an included record therefore does not end the check; the receiver carries on with your next term.
If an included domain publishes no SPF record, perhaps because the service was retired or the name has a typo, the result is a permanent error for the whole check.
redirect hands the whole check to another domain's record, but only when nothing in your record matched. A record that ends in an all term never reaches its redirect. If the redirect target has no SPF record, the result is a permanent error.
Worked example: over the limit
A company uses Google Workspace and Microsoft 365 for mailboxes, Mailgun and SendGrid for product email, Salesforce for sales email, and one server of its own. The obvious record lists them all.
Measured from public DNS on 26 November 2026: Google Workspace costs 1 lookup, Microsoft 365 costs 1, Mailgun costs 5 (its record includes two more records, which include further records), SendGrid costs 2, Salesforce costs 2, and mx and a cost 1 each. That is 13 lookups, three over the limit, so SPF fails for all of this domain's mail. Providers change their records, so these numbers move over time; check your own record rather than copying them.
example.comv=spf1 include:_spf.google.com include:spf.protection.outlook.com include:mailgun.org include:sendgrid.net include:_spf.salesforce.com mx a ~all13 DNS lookups: over the limitWorked example: back under the limit
SPF is checked against the envelope sender (the Return-Path), not the From address people see. Many sending services can send with a subdomain of yours as the envelope sender: Mailgun with its own sending domain, SendGrid with domain authentication, Amazon SES with a custom MAIL FROM domain. Their SPF then belongs at that subdomain, and your main record no longer has to carry it. Under DMARC's default relaxed alignment, a subdomain envelope sender still aligns with your main domain.
In this example Microsoft 365 is no longer used, Mailgun and SendGrid send from their own subdomains, and the company's server is listed by address instead of through mx and a. The main record falls to 3 lookups, and the Mailgun subdomain has its own record, with its own limit of ten.
example.comv=spf1 include:_spf.google.com include:_spf.salesforce.com ip4:192.0.2.10 ~all3 DNS lookupsmg.example.comv=spf1 include:mailgun.org ~all5 DNS lookups, counted separately for mail sent with this envelope senderOther common permanent errors
Two SPF records at the same name: receivers must return a permanent error rather than pick one. Merge them into one record.
An include of a domain that publishes no SPF record, often a service you stopped using or a mistyped name.
More than two void lookups, usually a or mx terms for names that no longer exist.
A redirect to a domain without an SPF record.
Keep the record short as well: RFC 7208 recommends keeping the DNS answer under 512 bytes, because larger answers can fail with older DNS software.
How to investigate
Work out what each term costs and whether it is still needed before changing anything.
- Run the free email security checker on the domain. It follows every include and redirect, counts the lookups against the limit of ten, and reports void lookups and included records that are broken.
- Write down the service behind each include, and ask the team whether each one still sends email for this domain.
- For each service, find the envelope sender it uses: open a message it sent, show the original, and read the Return-Path. If it is a subdomain of yours, its include belongs on that subdomain.
- Replace a and mx terms with ip4 or ip6 addresses for servers you run yourself, and keep those addresses up to date.
- Publish the new record, replacing the old one, and run the check again.
Fixes to avoid
Flattening replaces includes with the providers' IP addresses. It brings the count down, but the record no longer follows your providers: when one adds addresses, its mail starts failing SPF without warning. Use it only with something that updates the record automatically, and remember that whoever controls that tool then controls who may send as your domain.
ptr should not be used at all: RFC 7208 says it should not be published, because it is slow and unreliable.
Never end a record with +all or ?all to make failures go away: +all allows any server in the world to pass, and ?all says nothing about anyone.
What SPF cannot do
SPF covers the envelope sender, not the From address a reader sees. An include also authorises the provider's whole address range, which many of its customers share. So passing SPF alone does not prove a message came from you: DKIM signing with your own domain, and a DMARC policy, are what protect the From address.
See what your domain publishes today: run the free email security checker.