How SPF lookups work and when to flatten your SPF record
SPF lists the servers allowed to send mail for your domain. The record itself is short, but every include in it can pull in more records, and receivers stop counting at 10 DNS lookups. The SPF checker above shows that whole tree, which is usually where the problem hides.
SPF syntax and the 10 DNS lookup limit
| Part | Example | Uses a DNS lookup |
|---|---|---|
| ip4 / ip6 | ip4:192.0.2.10 | No |
| include | include:_spf.google.com | Yes, plus every lookup inside it |
| a / mx | a, mx | Yes |
| exists, redirect, ptr | redirect=_spf.example.com | Yes (ptr is deprecated) |
| all | ~all or -all | No |
Qualifiers set the result: -all means fail, ~all means soft fail, ?all is neutral and +all lets anyone send as you, which you should never publish. A record over 10 lookups returns PermError, and most receivers treat that as a failed SPF check. There's a second limit too: more than two lookups that return nothing (void lookups) also break the record.
Why you get "too many DNS lookups"
The count grows quietly. A team adds Google Workspace for mailboxes, a marketing platform, a CRM, a help desk and an invoicing tool, and each vendor asks for its own include. Some of those includes nest three or four more. Nobody sees the total until mail starts failing. Look through the lookup tree for services you no longer use and remove them first; it's the cheapest fix.
SPF flattening: benefits and risks
SPF flattening replaces includes with the IP addresses they resolve to, so the record uses zero lookups. It works, with one catch: providers change their IP ranges without notice, and a flattened record doesn't update itself. Re-check it at least monthly. A cleaner long-term option is to move each bulk sender to its own subdomain (news.yourdomain.com, billing.yourdomain.com), where every subdomain gets a separate SPF record and its own 10 lookups.
Other SPF errors the checker catches
Two SPF records on one domain are invalid, and receivers fail both every time, so merge them into one. A TXT string longer than 255 characters has to be split into several quoted strings, and some DNS panels cut it silently instead. A typo in an include domain turns into a void lookup that counts against your limit and authorises nothing. The ptr mechanism is deprecated and slow, so replace it with ip4 or include. If you're on Microsoft 365, our guide to setting up an Office 365 SPF record shows the correct form, and SPF alignment issues explains why a passing SPF can still fail DMARC.
Next step after you fix SPF
Starting from scratch? Build a clean record with the SPF Generator. SPF alone doesn't protect your domain, so check DKIM with the DKIM Checker and confirm your DMARC policy next. Warmy monitors SPF, DKIM and DMARC every day and alerts you when a vendor change breaks your record.
Stop finding SPF errors after the campaign. Try Warmy free for 7 days or book a demo.

























