SPF Record Generator
Pick the services that send your email and get a ready-to-paste SPF record, with the full DNS lookup count checked before you publish.
- Live DNS lookup
- Results in seconds
- No sign-up
- Free
Started from github.com’s current record. Change it below; publishing replaces the old one.
Your SPF record
v=spf1 ip4:192.30.252.0/22 ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 include:spf.protection.outlook.com include:mail.zendesk.com include:_spf.salesforce.com include:sendgrid.net include:_netblocks.google.com include:_netblocks2.google.com include:servers.mcsv.net include:mktomail.com ~all
- Type
- TXT
- Host / name
- @ (github.com)
- TTL
- Auto, or 1 hour
-
Note:The record is 320 characters long
One DNS text string holds 255 characters. Most DNS panels split longer records for you; if yours rejects it, split it into two quoted strings.
Advertisement
How to publish your SPF record
- Sign in wherever your domain’s DNS is managed: your registrar, Cloudflare or your web host.
- Look for an existing TXT record starting with
v=spf1. If there is one, edit it and replace its value. Don’t add a second one: two SPF records make SPF fail. - Otherwise add a new record: type TXT, host @ (some panels want your domain name, or leave it blank), and the generated text as the value.
- Save, wait a few minutes, then check it with the SPF checker.
What to include
List every service that sends email with your domain in the return path: your mailbox provider, newsletter and marketing tools, transactional email APIs, help desks, CRMs and shop platforms. Forgetting one means its mail fails SPF; listing services you no longer use wastes lookups and lets them keep sending as you.
Some services, including Mailchimp, HubSpot and Klaviyo, send with their own return-path domain, so they don’t need an include at all. They need DKIM set up instead.
After SPF: DKIM and DMARC
SPF is one of three records. DKIM signs your mail, and DMARC tells receivers what to do when SPF and DKIM fail. Gmail, Yahoo and Microsoft now require all three from bulk senders. See SPF, DKIM and DMARC explained, and if you’re near the lookup limit, how to get under 10 lookups.
Frequently asked questions
How do I create an SPF record?
Pick every service that sends email with your domain (your mailbox provider, newsletter tool, help desk and so on), add any servers of your own, and choose a policy for everything else. Then add the result as a TXT record at your domain’s root (the host is usually @) in your DNS provider’s panel.
Where do I add the SPF record?
In the DNS settings wherever your domain’s name servers are: often your registrar (GoDaddy, Namecheap), Cloudflare, or your web host. Add a TXT record with host @ (or your domain name) and the generated text as the value. If an SPF record is already there, replace it rather than adding a second one.
Can I have more than one SPF record?
No. A domain may publish exactly one TXT record starting with v=spf1, and two or more make SPF fail. To add a service, put its include into your existing record. Enter your domain above to start from the record you already have.
Should I choose ~all or -all?
~all (soft fail) is the usual choice and what Google and Microsoft suggest: once DMARC is in place, it’s DMARC that decides what happens to failing mail. -all is stricter and fine once you’re sure every sender is listed. Never use +all.
Why does the lookup count matter?
Checking an SPF record may use at most 10 DNS lookups. Each include costs one, plus whatever its own record uses, and some services nest several more includes inside theirs. Past 10, SPF fails for every message. This generator counts the full total, includes followed, before you publish.
My email service isn’t in the list. What do I add?
Look in its setup or domain-authentication docs for an “include:” value and paste the domain into “Other includes”. Many newsletter tools (Mailchimp, HubSpot, Klaviyo) send with their own return-path domain and need DKIM rather than an SPF include.
Did this tool do what you needed?
Related tools
All toolsSPF Record Checker
Validate an SPF record, follow every include and count DNS lookups against the limit of 10.
DMARC Record Checker
Read a domain’s DMARC policy in plain words and see what to change before tightening it.
Email Domain Health Check
SPF, DKIM, DMARC and MX checked together, with a score and a list of fixes.