Free tool
SPF Record Generator
Build an SPF TXT record from your sending services and IPs, with a DNS lookup count and length check.
How it works
What is the SPF Record Generator?
The SPF Record Generator is a free tool that builds the SPF TXT record for a domain. Tick the services that send your mail, add any IP addresses, choose how to treat everything else, and copy the result. It counts the DNS lookups the record needs and warns above the limit of 10 or past 255 characters.
How to use the SPF Record Generator
- Tick each service that sends email for your domain, or add its include value by hand.
- Add the IPv4 or IPv6 addresses of any servers of your own that send mail.
- Choose the rule for everything else:
~all,-allor?all. - Copy the value into a TXT record at the root of your domain, replacing any existing SPF record.
What is an SPF record?
SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send email for a domain. A receiving server looks it up, compares the connecting IP address with the list, and treats a mismatch as a sign the message may be forged.
The record starts with v=spf1, lists mechanisms such as include:, ip4: and mx, and ends with an all rule for every sender not listed. SPF checks the return-path address, not the From address a reader sees, which is why it is paired with DMARC.
How do I create an SPF record?
List every system that sends mail as your domain: the mailbox provider, the newsletter tool, the helpdesk, the billing system, your own servers. Tick the ones this tool has a preset for and type the include value for the rest, taken from that service's setup page. Add your own servers as ip4 or ip6 entries.
Then publish the output as a TXT record on the root of the domain; most DNS hosts call that host @. To see the record you have now, run the MX Record Checker, which prints the current SPF value.
What is the SPF 10 DNS lookup limit?
A receiver will do at most 10 DNS lookups while evaluating one SPF record. Each include, a, mx, exists and redirect costs one. ip4, ip6 and all cost none. Go over 10 and the result is a permanent error, which DMARC counts as an SPF failure.
Includes nest. A provider's record often includes two or three more of its own, and each of those counts. This tool counts the mechanisms in the record it builds and cannot see inside other domains' records, so the true total is higher than the number shown. Keep the top-level count low and remove services you no longer use.
Should I use ~all or -all?
-all (fail) says mail from any server not listed is not from you. ~all (soft fail) says it probably is not, and asks receivers to accept it with suspicion. ?all (neutral) says nothing and gives no protection.
~all is the common choice while you are still finding every sender, and it remains reasonable once DMARC is in place, because DMARC then decides what happens to failing mail. Use -all for a domain that sends no mail at all: v=spf1 -all is the whole record. Avoid +all, which authorises the entire internet; this tool does not offer it.
Can a domain have two SPF records?
No. A domain must publish exactly one record beginning with v=spf1. Two of them cause a permanent error and SPF fails for all mail, which is a common result of adding a new service by pasting its record next to the old one. Merge them into one record with several include entries, which is what this tool produces.
A single TXT string is also limited to 255 characters. A longer record has to be split into several quoted strings inside one TXT record, and the tool shows that split version when you need it. Next, sign your mail with a key from the DKIM Record Generator and set a policy with the DMARC Record Generator.
Questions
- Where do I add the SPF record?
- In your DNS host's control panel, as a TXT record on the root of the domain (host
@or blank). A subdomain that sends mail under its own name needs its own record. - My email service is not in the list. What do I enter?
- Find the SPF step in that service's domain setup guide and copy the value after
include:into the other include domains box. The presets cover only values this tool is certain of. - Do I need an SPF include for every service?
- Not always. Some services send with their own return-path domain and pass SPF there, relying on DKIM for alignment with your domain. Follow each service's setup page.
- Does the generator check my live DNS?
- No. It builds a record from what you enter and does not look anything up, so it cannot count nested lookups or see your current record.
- Is the SPF Record Generator free?
- Yes, with a free spyc.ai account. It runs in your browser, so nothing you type or paste is sent to a server.
Email and DNS Tools
More in Email and DNS Tools
DNS Lookup
See the A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records a domain publishes, with TTLs for its addresses.
Look up DNSMX Record Checker
List a domain's mail servers by priority with their IPs and likely provider, and see if SPF and DMARC exist.
Check MX recordsEmail Blacklist Checker
Check a domain's mail server IPs, or one IPv4 address, against five public spam blocklists.
Check blacklistsReady when you are
Before your next buyer asks AI about you, ask AI about yourself
One check, four engines, about twenty seconds. We show you the answers before we ask for anything.