You see this in a report, a header or a checker:
spf=permerror (too many DNS lookups)
Received-SPF: PermError ... SPF Permanent Error: Too many DNS lookups
SPF limits the number of DNS lookups a receiver does while evaluating your record to 10 (RFC 7208, section 4.6.4).
If your record needs more, the result is permerror and receivers treat SPF as failed, for every message, from every service.
What counts
| Counts as a lookup | Free |
|---|---|
include:, a, mx, exists:, redirect=, ptr | ip4:, ip6:, all |
Nested lookups count too. include:_spf.google.com costs 1 for the include, plus the includes inside Google's record.
Some providers' records cost 3 or 4 lookups on their own. That's how a record with five includes quietly ends up at 12.
How to get under 10
- Remove services you no longer use. Old newsletter tools and previous mail providers are common leftovers.
- Remove includes that aren't needed. If a platform sends with its own bounce domain (check the Return-Path of a message it sent), your SPF record is never checked for its mail. Its include does nothing; DKIM is what makes its mail pass DMARC.
- Replace
aandmxwithip4:/ip6:when they only cover a few fixed addresses of your own. - Move services to a subdomain. Let your marketing platform use
news.example.comas its bounce domain, with its own SPF record. Each subdomain gets its own budget of 10. - Flatten only as a last resort. Replacing includes with the IP addresses they currently contain works until the provider changes its addresses, and then mail breaks without warning. If you flatten, you have to re-check it regularly.
Stay at 8 or 9 rather than exactly 10, so the next tool someone connects doesn't push you over. There's also a separate limit of two void lookups.