Free tool · Generate
SPF record generator
Tick the services that send email for your domain, add any servers of your own, and copy a valid SPF record. The lookup count updates as you go.
What the SPF generator builds
It builds one valid SPF TXT record from the services and servers that send mail for your domain, and counts the DNS lookups the record will cost as you go. A correct record lets receivers confirm your mail came from a server you approved; a second record or more than 10 lookups makes SPF fail for everything.
How to read the record (SPF syntax)
- v=spf1
- The version tag. It must come first, and a domain can have only one record that starts with it.
- include:domain
- Pulls in another domain's SPF record, usually your provider's. Costs at least one DNS lookup, plus any inside it.
- ip4: / ip6:
- Lists an address or range directly, like
ip4:203.0.113.0/24. Costs no lookups. - a / mx
- Allows the IPs of your domain's A or MX records. Each costs a lookup; leave them out unless those servers send mail.
- ~all
- Soft fail for everything not listed. The safe default.
- -all
- Hard fail for everything not listed. Use it once every service that sends for you is in the record.
- +all
- Allows every server on the internet. The generator never produces it, and you should never publish it.
- Lookup meter
- Green below 8, amber at 8 to 10, red over 10. Red means SPF will fail for every message: drop services you don't use.
Publishing the record
Add it as a TXT record at the root of your domain (the host is @, or blank at some DNS providers). If there's already a v=spf1 record, replace it rather than adding a second one.
Then run the SPF checker on your domain to confirm it's live and under the lookup limit.
Fix this by sending through Groundmail.
Add your domain and we give you the exact SPF, DKIM, DMARC and return-path records, check them for you, and sign every message with your own domain's key. Free for 3,000 emails a month.
Questions
What is the SPF record syntax?
v=spf1, then mechanisms that say who may send (include:, ip4:, ip6:, a, mx), then an all at the end that says what to do with everyone else (~all soft fail, -all fail). Terms are separated by single spaces, and the whole record is one TXT value.
What does an SPF record example look like?
For a domain that uses Google Workspace for mailboxes and Zendesk for support email: v=spf1 include:_spf.google.com include:mail.zendesk.com ~all. Add an ip4: term for any server of your own that sends directly.
How do I create an SPF record?
List every service that sends mail as your domain (your mailbox provider, your transactional email API, your marketing tool, your helpdesk), add each one's include, and end with ~all. This generator does that and checks the lookup count.
What does include: mean in SPF?
It pulls in another domain's SPF record, so a provider can change its servers without you editing yours. Each include costs at least one of your 10 DNS lookups.
Do I need SPF if I have DKIM?
Yes. Gmail and Yahoo require both from bulk senders, and DMARC passes if either one passes and lines up with your From domain, so having both gives you a fallback.