SPF Record Generator
Our SPF generator turns the services that send your email into one valid SPF record, using each provider's documented include, with a running count of the 10-lookup limit.
Runs entirely in your browser. Nothing you add is sent to us.
Create a free account to use the SPF Record Generator
Free forever for this tool. Takes a few seconds — then you come straight back here.
- All 150 free tools, one login
- Free website audit with fixes
- Search Console dashboard
- Free keyword rank tracker
Already have an account? Sign in
Published it? Verify it with the free SPF checker →
Our SPF record generator builds one valid Sender Policy Framework record from the services and servers that send email as your domain. Search the provider list, tick the platforms you use, add any IP addresses or extra includes, and choose how strictly unlisted senders should be treated. The record updates as you go, with a running count against the 10-lookup limit, warnings for duplicates and records over 255 characters, and a live check that expands every include over DNS before you publish.
How to use the SPF generator
- 1 Tick the services that send for youSearch the list and tick each mailbox, marketing, helpdesk or CRM platform that sends as your domain. Providers whose own docs say no root include is needed are marked, and the generator explains why instead of adding a value.
- 2 Add your own servers if neededTick a or mx only if your web or mail server sends mail directly, and enter any IPv4 or IPv6 addresses or ranges you control. Paste any other includes from a provider's setup guide in step 3.
- 3 Choose the all qualifierPick ~all (soft fail) while you confirm every sender, then switch to -all (hard fail) once you are sure nothing is missing.
- 4 Check the lookup countWatch the counter and warnings, then use Check live lookup count to see the real total once every nested include is followed.
- 5 Publish and testCopy the record into a TXT record at host @, replacing any existing v=spf1 record, then run the SPF Checker on your domain once the change has propagated.
How to publish it
Add the generated value as a TXT record on your root domain (host "@" in most DNS panels). If a v=spf1 record already exists, replace it — a domain must have exactly one SPF record, and two make SPF fail.
Why the lookup count matters
Every include, a and mx mechanism costs a DNS lookup when a receiver evaluates your record, and includes can contain more includes. More than 10 lookups in total and SPF returns a PermError, which counts as a fail. The counter shows a minimum while you build; "Check live lookup count" expands every include over DNS for the real total.
What an SPF record generator does for you
An SPF record is a single line of text, but the rules around it are strict. RFC 7208 allows only one v=spf1 record per domain, expects mechanisms separated by single spaces, limits evaluation to ten DNS lookups and puts the all mechanism last. One slip, such as a second record, a stray comma or a typo in an include, turns the result into a PermError, and receivers then treat your legitimate mail as unauthenticated.
A good SPF generator removes most of that risk. This one always starts with v=spf1, adds the ip4:, ip6: and include: prefixes for you (or strips them if you paste them twice), removes duplicate mechanisms and tells you it did, refuses invalid addresses and domains, and always places your qualifier at the end. It never generates ptr, which RFC 7208 says not to use, and it never offers +all, which would let every server on the internet send as you.
Where the provider values come from
Every include in the provider list is taken from that provider's own documentation, and each entry links to its source. Where we could not confirm a value from the provider itself, it is left out rather than guessed. That matters because a misspelt include points at a domain with no SPF record, which RFC 7208 treats as a PermError for your whole record.
Some well-known platforms are listed with no include at all. Mailchimp, Mailchimp Transactional, SendGrid, Amazon SES, Postmark, Klaviyo, Constant Contact, Shopify store email, Squarespace Email Campaigns and Brevo on shared IPs all send with their own return-path (envelope) domain, or one you point at them with a CNAME. Receivers check SPF on that domain, not on your root, so adding an include there wastes a lookup and changes nothing. DMARC alignment for these services comes from DKIM, so publish the DKIM records they give you instead.
A few providers have variants. Microsoft 365 uses a different include for GCC High and DoD tenants and for the service operated by 21Vianet. Brevo needs spf.brevo.com only on a dedicated IP. HubSpot gives each account its own include, shown in its domain settings, so the generator asks you to paste it rather than inventing one.
How the SPF generator counts DNS lookups
Receivers stop evaluating an SPF record after ten DNS lookups and return a PermError, which DMARC treats as a fail. Each include, a and mx mechanism costs one lookup, and so does every include nested inside a provider's record. The ip4, ip6 and all mechanisms cost nothing.
While you build, the counter adds one lookup for each a and mx and at least one for each include, and labels the total "at least" whenever an include is present. Providers rarely publish how many lookups their includes use, and they can change them at any time, so a fixed number would be a guess. To see the real figure, press Check live lookup count: the tool follows every include in your generated record over DNS, exactly as a receiver would, and shows the cost of each one, before anything is published. The SPF Checker does the same for the record that is already live.
If you are over the limit, remove services you no longer use first. Then consider replacing a and mx with the specific ip4 addresses they resolve to if those rarely change, using a provider's narrower regional include where it documents one, or moving bulk and marketing mail to a subdomain with its own SPF record.
Choosing between ~all and -all
The final mechanism tells receivers what to do with mail from servers that are not in your list. This SPF record generator offers the two settings worth publishing.
- ~all, soft fail: unlisted servers are marked as suspicious but usually still accepted. The safest place to start while you confirm every service that sends for you.
- -all, hard fail: unlisted servers should be rejected. The strongest setting once you are confident the list is complete, and the right one for domains that never send email (v=spf1 -all on its own).
- +all is never offered because it passes every server on the internet, and ?all is left out because it offers no protection at all.
Long records and the 255-character limit
A single string inside a DNS TXT record can hold at most 255 characters. A record with many includes can pass that, and the generator warns you as soon as it does. Most DNS panels split long values automatically, so try pasting the full record first.
If your panel rejects it, copy the split version the generator shows. It breaks the record into quoted strings at spaces, such as "v=spf1 include:a.example ... " "include:b.example ~all", all inside the same TXT record. Receivers join the strings back together without adding anything between them, so each string except the last keeps its trailing space; without it, two mechanisms would run together and break the record. Very long records, above roughly 450 characters, can also outgrow a single DNS response, which is another reason to keep the list short.
Publishing the record and testing it
Before you publish, check whether the domain already has a v=spf1 record. If it does, edit that record rather than adding another, and make sure anything it contained that you still need is in the generated version. Two SPF records cause a PermError for every message, which is one of the most common causes of sudden delivery problems after a new service is set up.
Publish the record wherever your domain's nameservers point, which may be your registrar, your web host or a DNS service rather than your email provider. Add or edit a TXT record with the host @ (some panels want the host left blank for the root domain), paste the record as the value and save. A subdomain that sends its own mail, such as news.example.com, needs its own record, because subdomains do not inherit the root domain's SPF.
Allow time for the old record's TTL to expire, then run the SPF Checker on the domain. It reads the live record, expands every include and reports the lookup count, void lookups and any syntax problems, so you can confirm that what is published matches what you built.
SPF best practice for any domain
Gmail and Yahoo require senders to pass SPF or DKIM, and bulk senders to have both plus a DMARC record with alignment. Microsoft applies comparable requirements to high-volume senders to Outlook.com addresses. For most organisations, a correct SPF record built with an SPF generator, DKIM switched on with every provider and a DMARC record starting at p=none meet these rules wherever in the world you send from.
Review the record whenever you add or retire a tool that sends email, and keep a note of why each include is there. Months later, nobody remembers which include belonged to a trial CRM, and unused includes waste lookups. Domains you own but never send from should publish v=spf1 -all, plus a DMARC reject policy, so nobody can use them to impersonate you.
Examples you can copy
Google Workspace only, soft fail while you confirm other senders
v=spf1 include:_spf.google.com ~all
Microsoft 365 plus Zendesk and an office server on a fixed IP, hard fail
v=spf1 ip4:198.51.100.25 include:spf.protection.outlook.com include:mail.zendesk.com -all
Website server (A record), Zoho Mail and an IPv6 range
v=spf1 a ip6:2001:db8::/32 include:zohomail.com ~all
Google Workspace with Mailchimp and Amazon SES: no extra includes on the root, because both use their own return-path domains
v=spf1 include:_spf.google.com ~all
A domain that never sends email
v=spf1 -all
A long record split into two quoted strings in one TXT record (note the space before the closing quote)
"v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:mailgun.org " "include:mail.zendesk.com include:_spf.salesforce.com -all"
Common mistakes to avoid
Adding the generated record alongside the old one
Two v=spf1 records cause a PermError and SPF fails for every message. Replace the existing record instead of adding another.
Adding includes for services that do not need one
Platforms that send with their own return-path domain, such as Mailchimp, SendGrid with automated security, Amazon SES and Postmark, gain nothing from a root include. It only uses up lookups.
Trusting the top-level count alone
Includes nest further includes. Four includes can easily cost more than ten lookups in total, so check the live count before publishing.
Switching to -all before testing
If a forgotten service sends invoices or alerts, a hard fail can get them rejected. Start with ~all, test every sender, then move to -all.
Splitting a long record without trailing spaces
Receivers join quoted strings with nothing in between, so "...mailgun.org" "include:..." becomes one broken term. Keep a space at the end of each string, as the split version here does.
Frequently asked questions
Start with ~all (soft fail) while you confirm every service that sends for you is listed, then switch to -all (hard fail) so receivers reject mail from anywhere else.
Your provider's setup guide gives the exact include, usually something like include:spf.provider.com. Paste it into the custom includes box.
Only for servers you run yourself, such as a web server that sends contact-form mail. Hosted email services are covered by their include.
Those providers send with their own return-path domain, or one you CNAME to them, and receivers check SPF on that domain. Their own documentation says a root include is unnecessary, so we link to it and leave the include out.
A and mx count exactly one each. Includes count at least one, because what they nest changes over time. Check live lookup count follows every include over DNS for the real total.
Publish v=spf1 -all. It tells receivers that no server may send as the domain, which stops spoofers using a parked or unused domain.
Create the TXT record on the subdomain itself, for example with the host news for news.example.com. Subdomains do not inherit the root domain's SPF record.
No. It builds the record in your browser for you to copy. The optional live check sends only the generated record and domain to resolve its includes, and nothing is stored.
Learn more
- What Is an SPF Record? Syntax, Examples and Common Mistakes Learn what an SPF record does, how to read each mechanism and qualifier, copy-ready examples for Google, Microsoft 365 and ESPs, and mistakes that break SPF.
- SPF PermError Too Many DNS Lookups: How to Fix the 10 Limit Fix SPF PermError too many DNS lookups: how the 10-lookup limit is counted, how to audit nested includes, and safe ways to trim, move to subdomains or flatten.
- Email Authentication Checklist for Small Businesses (2026) A one-page email authentication checklist for small businesses: SPF, DKIM, DMARC, unsubscribe, MTA-STS, BIMI and parked domains, with the records to publish.
Free website audit
See how your site scores, free
Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.