An SPF record lists the servers allowed to send mail for your domain. It looks simple, but it carries a hard limit: while evaluating SPF, a receiver performs at most 10 additional DNS lookups. Exceed that and the result is permerror, which means SPF effectively stops working. The problem creeps in slowly, because every new CRM, newsletter tool or helpdesk adds another include until one day mail starts landing in spam.
Which mechanisms count
RFC 7208 lists the mechanisms that trigger lookups: include, a, mx, ptr, exists and the redirect modifier. ip4, ip6 and all cost nothing. Counting is recursive: every lookup inside an included record counts toward the same total of 10. The standard also recommends limiting "void" lookups that return nothing to two, so stale includes of cancelled services hurt twice.
| Mechanism | Counts? | Note |
|---|---|---|
ip4, ip6 | No | Literal address or network |
a, mx | Yes | mx also resolves each MX host |
include | Yes | Nested lookups count too |
ptr | Yes | Discouraged by the standard |
How the failure shows up
Receivers may file the message as spam or, under a strict DMARC policy, reject it. The Authentication-Results header shows spf=permerror, and DMARC reports say the same. Owners often miss it because DKIM keeps DMARC passing, but any system without a valid DKIM signature relies on SPF alone.
Checking the record
dig +short TXT example.uz | grep spf1
dig +short TXT _spf.crm-xizmat.com
Open each include and count what is inside, or use a free online SPF validator that expands the whole tree. Also confirm there is only one v=spf1 record; two records also produce permerror.
Getting back under the limit
Remove what you do not need
Delete includes for services you no longer use. If your website and mail share one server with a stable address, replace a and mx with a single ip4. If your MX hosts only receive mail, mx is unnecessary.
Move senders to subdomains
SPF is evaluated against the envelope (Return-Path) domain, so sending newsletters from news.example.uz gives that subdomain its own record and its own budget of 10. Most newsletter platforms support a custom return-path domain.
Flattening, carefully
Flattening replaces includes with the provider's current IP ranges. It slashes the lookup count, but the record goes stale when the provider changes addresses. Do it by hand only for your own stable servers; for large cloud providers use a tool that refreshes the list automatically, or prefer subdomains.
Example: a Tashkent logistics company
A logistics firm uses a cloud office suite for mail, sends order notifications from its hosting server, works with clients through a CRM, runs a monthly newsletter and uses a helpdesk. Its record has a, mx and five includes, 13 lookups in total. The administrator replaces a and mx with the server IP, removes a newsletter service cancelled two years ago and moves newsletters to news:
v=spf1 ip4:203.0.113.25 include:spf.ofis-bulut.com include:_spf.crm-xizmat.com include:_spf.helpdesk.io ~all
# news.example.uz
v=spf1 include:spf.tarqatma.net ~all
The address shown is a documentation example; use your real server IP.
Keeping it tidy
Check the total lookup count before adding any service, keep a short note of which part of the record belongs to which service, and remove entries the day a service is cancelled. End the record with ~all or -all, never +all. TXT records can be edited in the sayt.uz cabinet's DNS section; re-run a validator after every change.