SPF record generator and checker
An SPF record is a TXT record that lists which servers may send email for your domain. Pick your senders below to build one, or enter a domain to check its live record and its DNS lookup count (the limit is 10).
Add this as a TXT record on your domain (host @)
v=spf1 ~allAbout 0 of 10 allowed DNS lookups, counting the includes inside each listed service. Check the domain after you publish for the live count.
The generator runs entirely in your browser. The checker asks Cloudflare's public DNS resolver directly from your browser (Google Public DNS if Cloudflare does not answer). Nothing is sent to RelayMail.
How to use it
- Open "Build a record" and tick every service that sends email as your domain, such as Google Workspace or SendGrid.
- Add any server IP addresses you run yourself, and choose ~all while testing or -all once the list is complete.
- Copy the record and publish it as a TXT record at the root of your domain (host @). Replace any existing SPF record.
- Open "Check a domain", enter your domain and read the result: the record, lookups used out of 10, and any warnings.
- If the count is over 10, remove services you no longer use or swap includes for fixed IP ranges.
What counts toward the 10 lookup limit
RFC 7208 allows at most 10 DNS-querying terms while a receiver evaluates SPF. The terms include, a, mx, ptr, exists and redirect each count one, and every include adds the lookups inside the record it points to. ip4, ip6 and all cost nothing. Separately, more than 2 lookups that come back empty (void lookups) is also a permanent error.
Go over 10 and receivers return a permanent error, which most treat as an SPF failure for all of your mail. The checker walks the whole include tree so you see where the count comes from.
Questions
Can a domain have more than one SPF record?
No. Two records starting with v=spf1 cause a permanent error. Merge every sender into a single record.
Should I end with ~all or -all?
~all marks other servers as suspicious and is the usual starting point. Switch to -all after you confirm every legitimate sender is listed, since -all asks receivers to reject the rest.
What happens if I exceed 10 DNS lookups?
Receivers stop evaluating and return a permerror. SPF then fails for all mail from the domain, which hurts delivery and DMARC alignment.
How do I reduce lookups?
Drop services you stopped using, replace includes with ip4 or ip6 ranges where the provider publishes stable ones, and send marketing mail from a subdomain with its own SPF record.
Does SPF alone stop spoofing?
SPF checks the hidden envelope sender, not the From address people see. Pair it with DKIM and a DMARC policy so receivers check the visible From domain too.
How long until a new record works?
Resolvers cache the old answer for the record's TTL, often 5 minutes to an hour. Check again after the TTL passes.
See also
More free email tools
Updated .
