Free tool SPF record generator: one record for every service that sends your mail
Tick the services that send email as your domain — Google Workspace, Microsoft 365, SendGrid, Mailgun, Amazon SES and others — add any servers of your own, and get a single v=spf1 TXT record. The generator counts the DNS lookups each include costs, warns before you pass the limit of 10, and links to the live checker once you publish.
- 16 services built in
- RFC 7208 checks
- Runs locally
Build your SPF record
Everything that sends mail with your domain in the sender address must be listed. The record updates as you tick.
Saved to My tools
Open the free tools page next time and it is right at the top under My tools (stored in this browser only).
You can also press Ctrl+D to bookmark this page in your browser.You can also press ⌘+D to bookmark this page in your browser.You can also tap your browser’s Share button (at the bottom in Safari) and choose Add Bookmark or Add to Home Screen.You can also open the ⋮ menu at the top right and tap ☆ to bookmark it, or choose Add to Home screen.You can also tap ··· at the top right and choose Favorite, or open it in your browser and bookmark it there.
View My toolsThe domain in your sender addresses. Used for the DNS row and the check link; leave empty to build a record for any domain.
~all marks it suspicious, -all asks receivers to reject it. Start with ~all, move to -all once DMARC reports look clean.
Office mail servers, a website that sends contact-form mail, printers. One per line; ranges like 203.0.113.0/24 work.
One per line, for example 2001:db8::/48.
For a service not listed: paste the value from its setup page, with or without include:. One per line.
v=spf1 include:_spf.google.com include:sendgrid.net ~allPublish it as the only TXT record starting with v=spf1 on the domain.
DNS lookups
3
Limit 10
Characters
56
A TXT string holds 255
Checks
- OK3 of 10 allowed DNS lookups used.
- Note“~all” (soft fail): mail from unlisted servers is marked suspicious but usually still delivered. Common while you confirm every sender is listed.
- NoteSendGrid: with “automated security” on, SendGrid publishes SPF for its own return-path subdomain through a CNAME, and the include is not needed on your root domain.
- NoteAll services go in this one record. A second v=spf1 record on the same domain makes SPF fail for every message.
DNS record to add
In most DNS panels, @ means the domain itself. Replace any existing v=spf1 record instead of adding a second one.
| Type | Host | Value | TTL |
|---|---|---|---|
TXT | @ | v=spf1 include:_spf.google.com include:sendgrid.net ~all | 3600 |
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com include:sendgrid.net ~all"For BIND or DNS panels that import zone files; long records are already split into 255-character strings.
After publishing
Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/spf-record-generator
Done here? Try these next
Use this tool often? Save it to My tools.Saved to My tools. Find it any time at the top of the free tools page. You can also press Ctrl+D to bookmark this page in your browser.You can also press ⌘+D to bookmark this page in your browser.You can also tap your browser’s Share button (at the bottom in Safari) and choose Add Bookmark or Add to Home Screen.You can also open the ⋮ menu at the top right and tap ☆ to bookmark it, or choose Add to Home screen.You can also tap ··· at the top right and choose Favorite, or open it in your browser and bookmark it there.
Problem or suggestion?Send feedbackChat with support
Version v1.0Updated Update history
Use it via API:site/email-auth
What the record says
An SPF record is a list of places allowed to send mail for the domain, read left to right.
- 16 sending services built in
- Counts the 10-lookup limit
- Copy the TXT record, then check it live

v=spf1
Marks the TXT record as SPF. There must be exactly one per domain; two records are a permanent error, not a merge.
ip4 / ip6
Addresses written directly into the record. They cost no DNS lookups, which is why they come first.
include
Hands the decision to another domain’s SPF record, usually your email provider’s. Each costs at least one lookup, plus whatever that record includes in turn.
~all / -all
What to do with mail from anywhere not listed. DMARC treats both as an SPF failure; -all asks receivers to reject outright.
SPF checks the envelope sender (Return-Path), not the From address people see. DMARC ties the two together, so publish DMARC too.
Four steps
About five minutes, plus the time your DNS provider takes to publish.
-
1
List every sender
Your mailbox provider, newsletter and transactional email services, help desk, CRM, website contact form and any office server.
-
2
Tick and add
Tick the services, paste includes from other services’ setup pages, and add your own IP addresses.
-
3
Replace, do not add
At your DNS provider, edit the existing v=spf1 TXT record on the domain, or create one if there is none.
-
4
Check it live
After the change is visible, run the SPF checker: it follows every include and counts the real lookups.
Limits from RFC 7208
Receivers stop evaluating a record that breaks these limits and treat it as a permanent error, which DMARC counts as a fail.
- 10 DNS lookups in total: every include, a, mx, ptr, exists and redirect, including those inside the records you include
- 2 void lookups (names with no record) are the suggested maximum before receivers give up
- One record per domain; anything after
allis ignored - 255 characters per TXT string; longer records are split into several strings and joined when read
ptrshould not be used;+alllets the whole internet pass
| Service | Include | Lookups |
|---|---|---|
| Google Workspace | _spf.google.com | 1 |
| Microsoft 365 | spf.protection.outlook.com | 1 |
| SendGrid | sendgrid.net | 2 |
| Zoho Mail | zohomail.com | 2 |
| Mailgun | mailgun.org | 5 |
| Tencent Exmail | spf.mail.qq.com | 8 |
A company with three senders
Staff mail on Google Workspace, newsletters on SendGrid, and a web server at 203.0.113.25 that sends order confirmations.
| Sender | Term | Lookups |
|---|---|---|
| Web server | ip4:203.0.113.25 | 0 |
| Google Workspace | include:_spf.google.com | 1 |
| SendGrid | include:sendgrid.net | 2 (it includes ab.sendgrid.net) |
| Everyone else | ~all | 0 |
Result: v=spf1 ip4:203.0.113.25 include:_spf.google.com include:sendgrid.net ~all, 3 lookups. Adding Tencent Exmail (8) would push it to 11, over the limit; move that sender to a subdomain instead.
What breaks SPF
Most broken records come from adding a service without touching what is already there.
A second v=spf1 record
New service, new TXT record: now both fail. Always merge into the one record.
Too many includes
Each provider costs one or more lookups. Past 10, SPF fails for every message, not only the last sender.
+all or ?all
+all authorises every server on the internet; ?all protects nothing. Use ~all or -all.
Forgetting a sender
The help desk or invoicing tool that sends “as” your domain fails SPF once you switch to -all. DMARC reports show who you missed.
Live chat that does not depend on email getting through
When visitors write outside working hours, the TapCub widget takes their email and you reply by email. During working hours the conversation happens in the chat itself.
Offline messages
A message and an email address, in the same inbox as live chats. Replies by email need working SPF and DKIM to arrive.
Learn moreAlerts where agents are
Desktop alerts, email, WeCom, DingTalk, Feishu, Slack or a webhook, so a new chat is seen even when an email is not.
Learn moreHosted chat page
A chat link for email signatures that lands in the same inbox.
Learn moreSPF record generator questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I create an SPF record?
List every service that sends mail with your domain, tick them above or paste their include values, add your own IP addresses, and choose ~all or -all. Publish the result as one TXT record on the domain (host @), replacing any existing v=spf1 record.
What is the SPF record for Google Workspace and Microsoft 365?
Google Workspace: v=spf1 include:_spf.google.com ~all. Microsoft 365: v=spf1 include:spf.protection.outlook.com -all (21Vianet: spf.protection.partner.outlook.cn). If you use both, put both includes in one record.
Should I use ~all or -all?
Start with ~all while you confirm every sender is listed, then move to -all. DMARC treats both as an SPF fail; -all additionally lets receivers reject outright. Microsoft recommends -all once DKIM and DMARC are in place.
What happens if I go over 10 DNS lookups?
Receivers stop and return a permanent error, so SPF fails for every message, which DMARC counts as a fail. Fixes: remove services you no longer use, replace includes with stable IP ranges, or send bulk mail from a subdomain with its own record.
Can I have two SPF records?
No. Two v=spf1 records on one domain are a permanent error and both stop working. Merge them into one record with all the includes.
Do subdomains inherit the SPF record?
No. Each host name that sends mail needs its own record, for example news.example.com. Subdomains that never send can get v=spf1 -all.
Is SPF enough to stop spoofing?
No. SPF checks the hidden envelope sender, not the From address people see. Add DKIM signing and a DMARC policy so the visible domain is protected too.
Is this tool working for you?
Rate it, or tell us what went wrong and what you’d like improved. A person reads every message, and frequent requests go into the next update.
Need help right now?
Chat with our support team, best for urgent problems; you can leave a message when we are offline.
Chat with supportUpdate history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Recommend this tool in an article or on your site
This tool is free to cite and share. Copy the URL or link below into your article, tutorial or resource page; to write a review, embed a tool or partner with us, get in touch.
https://tapcub.com/tools/spf-record-generator<a href="https://tapcub.com/tools/spf-record-generator">SPF record generator - TapCub</a>Finish email authentication
SPF is the first of three records. Add DMARC to protect the From address and get reports on who sends as your domain.