Skip to content
Frosty Cyber Sec

Coming soon. Our products are not open to the public yet and nothing is on sale. Tell me when it opens

← Frosty Labs

Practical guide · 6 min read

SPF and the 10-lookup limit, explained

Why too many includes break delivery, and how to stay under the limit.

What SPF is for

An SPF record is a public list, published in DNS, of the servers allowed to send email for your domain. A receiving server checks the sending server against that list. On its own SPF does not sign or encrypt anything; it simply answers whether a given sender is allowed to send for your domain.

The hard 10-lookup limit

The SPF standard allows a maximum of 10 DNS lookups while evaluating a record. Mechanisms that trigger a lookup each count towards it: include, a, mx, ptr, exists and redirect. If evaluating your record needs more than 10 lookups, the result is a permerror, and many receivers treat a permerror as a failure. Plain ip4 and ip6 entries and the all mechanism do not count, so listing addresses directly is cheap.

Why a nested include is expensive

Each include points at another record that may contain its own includes. A single entry for your email provider can quietly pull in several more lookups behind it. Add two or three such providers and you are over the limit without realising, because most of the cost is hidden one level down.

How to count and flatten

  • Count the lookups your record causes, following every include down to the records it references.
  • Remove senders you no longer use; old newsletter and ticketing tools are common culprits.
  • Replace an include with the specific ip4 and ip6 ranges where a provider publishes stable addresses. This is called flattening.
  • Re-check after any change, and remember a flattened list needs maintenance whenever a provider changes its IP addresses.

Hardfail, softfail and the dangerous one

  • -all (hardfail): mail from anywhere not listed should be rejected. The strongest option, and the goal for most domains.
  • ~all (softfail): mail from elsewhere is accepted but marked as suspicious. A useful middle step while you test.
  • +all: accept mail from anywhere as if it were you. This disables SPF entirely and must never be used.

SPF alone is not enough

SPF breaks when mail is forwarded, because the forwarding server is not on your list. That is one reason DMARC leans on DKIM as well, and why SPF should be one part of a set that includes DKIM and DMARC rather than a control you rely on by itself.

General guidance, not legal or professional advice for your specific situation. Only test systems you own or are authorized to assess.

Frosty Shield is coming soon

It is built and is being checked before release. Leave your email address and we will tell you once, when it opens.