Recursive SPF with the 10-lookup limit, DKIM keys and DMARC policy
SPF Record Generator
Build a correct SPF record from your providers and IPs, in the right order with a minimum lookup count (limit 10) and automatic splitting of long text.
Workspace
Sending providers
How the result is calculated
The record is ordered by cost: mechanisms with no DNS query first (ip4 then ip6), then a and mx, then provider includes, ending with a single all rule. Duplicates are removed and every IP (4 parts 0–255 with /0–32, or IPv6 with /0–128) and domain is syntax-checked. “Minimum lookups” = the number of query-causing mechanisms (include, a, mx); provider includes use costs measured on 2026-10-13 (e.g. SendGrid 2, Mailgun 5), while custom includes count as 1 because their nested lookups cannot be seen, so verify with an SPF checker after publishing (limit 10, RFC 7208). If the text exceeds 255 characters it is split into quoted strings.
FAQ
Why ~all and not -all?
Start with ~all while discovering sources so legitimate mail from a forgotten source is not rejected, then move to -all once the list is certain.
Does SPF replace DKIM and DMARC?
No. SPF only covers the sending path. See the practical guide.


