Measure first, do not estimate
Your own record may hold three include: terms — resolved, that quickly becomes twelve queries, because each provider nests further. What counts is include, a, mx, ptr, exists and redirect, recursively. What does not count is ip4: and ip6: — they cost nothing.
The SPF check resolves the full chain and shows the total with a per-branch breakdown. Without that number any restructuring is guesswork.
Route 1 — clean up
The cheapest and by far the most common win. Nearly every grown record contains at least one service that has not sent in years: the retired newsletter tool, the test environment, the former host. The DMARC reports show in black and white which sources still produce messages. What has been missing there for weeks at count 0 can go.
Route 2 — substitute mechanisms
aandmxeach cost one lookup and usually resolve to a handful of fixed addresses. Entered asip4:they cost nothing. The price: if an address changes, you have to notice yourself.- Drop
ptrentirely. RFC 7208 explicitly advises against it, and many receivers no longer evaluate it anyway. - Flatten small
include:terms. If a provider has only two fixed IPs, replace theinclude:with the addresses. With large providers this is the wrong move — see below.
Route 3 — split across subdomains
The cleanest route when a lot of systems genuinely send. Each sending purpose gets its own subdomain with its own record and its own lookup budget:
The newsletter then sends as news@mail.yourdomain.com. This is not a trick but good practice: the reputation of bulk mail stays separate from business correspondence, and an incident on one does not hit the other. Remember that sp= in the DMARC policy governs those subdomains.
Route 4 — flattening
The include: chains are resolved and their IPs written into your own record. That drops the count to zero lookups, which is tempting. The costs are real:
- The record goes stale silently. When the provider changes addresses, SPF suddenly stops passing — with no warning and nothing having changed on your side.
- It gets long. A single TXT string holds 255 characters; longer records are split into several strings. That is legal, but any resolver mishandling it splits a mechanism in two.
- It needs automation. Hand-flattened records are wrong within six months. Flattening requires a process that re-resolves daily and updates the record.
It is defensible with small, stable providers. With large cloud providers that continuously adjust their ranges it is the worst of the four options.
What you should not do
Reverting -all to ~all or ?all does not remove the error — a record over the limit is invalid regardless of the qualifier. It only weakens protection. The same goes for deleting legitimate senders: they are then missing from the record and fail once DMARC is enforced.
How the symptom appears in the mailbox is covered at SPF permerror — too many DNS lookups.