SPF record generator
Tick the services that send mail for your domain, add your own servers and IP ranges, and get a ready-to-publish SPF TXT record.
Runs in your browser. Nothing is sent to Dizo. The lookup count covers the mechanisms in this record. Includes can contain more lookups of their own, so check the published record with the SPF checker.
How to use it
- Enter your domain so the DNS instructions show the right host.
- Tick each service that sends email as your domain, such as Google Workspace or Microsoft 365.
- Add any other
include:domains your vendors gave you, plusip4andip6ranges for your own servers. - Choose
~all(soft fail) or-all(hard fail) for every other server. - Check the lookup count and warnings, then copy the record into a single TXT record at
@.
What an SPF record does
SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send mail using your domain in the envelope sender (the Return-Path). A receiving server reads the record from left to right and stops at the first mechanism that matches the connecting IP address. If nothing matches, the final all mechanism decides the result.
A record always starts with v=spf1. The common mechanisms are include: (use another domain's SPF record), ip4: and ip6: (allow an address or range), a and mx (allow the servers behind your own A or MX records), and all. The qualifier in front of all sets the result for everyone else: -all is a hard fail, ~all is a soft fail, and ?all is neutral.
The 10-lookup limit, with a worked example
RFC 7208 caps the number of mechanisms that trigger DNS queries at 10 per SPF check. include, a, mx, exists, ptr and the redirect modifier each count as one, and nested includes count too. ip4, ip6 and all cost nothing. Go over 10 and receivers return a permanent error, which most treat as an SPF failure.
Example: mx (1) plus includes for Google Workspace (1), SendGrid (1) and Salesforce (1) gives 4 lookups in your record. If those providers' own records add 1, 2 and 3 more, the real total is 10, right at the limit. Adding one more vendor would break SPF for every message. This generator counts the lookups in your record. Use the SPF checker on the published record to see the nested total.
Common mistakes
Two SPF records. A domain must publish exactly one TXT record that starts with v=spf1. Two records give a permanent error, so merge new mechanisms into the existing record instead of adding another.
Leftover vendors. Old includes for tools you stopped using still spend lookups and still authorize those servers. Remove them. Jumping straight to -all. Start with ~all, watch your DMARC reports for legitimate senders you missed, then tighten. Forgetting subdomains. SPF is checked per domain, so a subdomain that sends mail, such as mail.example.com, needs its own record.
FAQ
Should I use ~all or -all?
Start with ~all while you confirm every legitimate sender is listed. Once your DMARC reports show nothing missing, -all is stricter. With an enforced DMARC policy, most receivers act on the DMARC result either way.
My vendor is not in the list. What do I add?
Use the exact include value from the vendor's own setup docs and paste it into Other includes. Some providers give each customer a unique value, so copy it from your account rather than guessing.
Where do I publish the record?
Create one TXT record at the root of the domain (host @) with the generated value. DNS changes usually show up within minutes to a few hours, depending on the TTL.
Does SPF alone stop spoofing?
No. SPF checks the envelope sender, not the From address people see. You need DKIM and a DMARC policy that requires alignment to protect the visible From domain.
Related tools
SPF record checker
Look up a domain's SPF record, follow every include, count DNS lookups against the 10-lookup limit and see what the all policy does.
DMARC record generator
Fill in a short form and get a correct DMARC TXT record, the exact host name to publish it on, and warnings about common mistakes.
DKIM record checker
Enter a domain and a DKIM selector to fetch the public key, check its type and length, and flag common problems.
DMARC record checker
Fetches the _dmarc TXT record for a domain, explains each tag and rates how well the policy stops spoofed mail.
DNS record lookup
Query the public DNS records of any domain or hostname, straight from your browser, and see every value with its TTL.