New: mailX now works inside ChatGPT. Try it →
Free SPF Record Generator

SPF Record Generator: Create a Valid SPF Record in Seconds

Enter your domain, pick the email provider that sends for you and choose soft or hard fail. mailX writes the SPF TXT record, or tells you when your provider does not need one.

Results

  • Free SPF generator
  • 49 email providers
  • No signup required

What this SPF generator gives you

A record built from each provider's own documentation, not a guess.

The right include

The exact include for your provider, such as include:_spf.google.com for Google Workspace or include:spf.protection.outlook.com for Microsoft 365.

A ready-to-paste TXT record

The full record, from v=spf1 to the final all, with the name to use in your DNS.

Soft or hard fail

~all (soft fail) to start safely, or -all (hard fail) once you are sure every sender is listed.

Provider notes

Region or plan variants, such as IONOS US vs Europe or Zoho data centers, and what to do when a provider needs a different setup.

When no root SPF is needed

Many sending services (SendGrid, Mailchimp, Postmark, Amazon SES...) handle SPF on their own return-path domain. The generator says so instead of adding a useless include.

49 services covered

Mailbox providers, hosting companies, marketing platforms, helpdesks and transactional email services.

How it works

How to create and publish your SPF record

Five steps to authorize your senders without breaking SPF.

01

List every service that sends as your domain

Your mailboxes (Google Workspace, Microsoft 365...), plus marketing, CRM, helpdesk and billing tools. Forgetting one is the most common SPF mistake.

02

Generate the record for your main provider

Pick it in the list and choose ~all to start. The result gives the value to publish.

03

Merge every sender into one record

A domain can only have one SPF record. If you use several services, put all their includes in the same record, before the final ~all or -all.

04

Publish it as a TXT record

Add it at the root of your domain (@ in most DNS hosts) and remove any older SPF record.

05

Check it

Run the SPF checker to confirm there is a single valid record, then move to -all when you are confident every sender passes.

What is an SPF record?

SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send email for your domain. When a message arrives, the receiving server checks whether the sending IP is authorized by the SPF record of the return-path domain. If it is not, SPF fails.

An SPF record always starts with v=spf1, lists mechanisms such as include:, ip4: or mx, and usually ends with an all qualifier: -all fails every unlisted sender, ~all soft-fails them. A redirect= modifier can replace it. SPF alone does not protect your From address: DMARC ties SPF to the visible From domain through alignment.

Two limits break many records. A domain can have only one SPF record, and evaluating it must not take more than 10 DNS lookups. Each include, a, mx, ptr, exists and redirect counts, including the lookups inside the includes.

SPF record for Google Workspace:

v=spf1 include:_spf.google.com ~all

Google Workspace and Microsoft 365 merged in one record:

v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all

SPF includes for popular email providers

These are the values the generator returns for the most used services. Add the include of every service you use to the same record.

Many marketing and transactional platforms do not need an include on your root domain. SendGrid, Postmark, Kit, ActiveCampaign, Intercom, Klaviyo, SparkPost, ZeptoMail and SMTP2GO pass SPF on a return-path subdomain of your domain once you add the CNAME records they give you. Amazon SES and Resend do the same with an MX and an SPF record on a MAIL FROM subdomain. Mailchimp, Mailchimp Transactional and Brevo use their own return-path domain, so DMARC passes through DKIM with your domain. In every case, set up their domain authentication instead. HubSpot is different: it gives you an SPF include specific to your account.

Mailbox providers:

Google Workspace: include:_spf.google.com
Microsoft 365: include:spf.protection.outlook.com
Zoho Mail (US data center): include:zohomail.com
iCloud+ custom domain: include:icloud.com
Fastmail: include:spf.messagingengine.com
Proton Mail: include:_spf.protonmail.ch
Yandex 360: include:_spf.yandex.net

Hosting and business email:

IONOS (US): include:_spf-us.ionos.com
IONOS (Europe): include:_spf-eu.ionos.com
Hostinger Email: include:_spf.mail.hostinger.com
Namecheap Private Email: include:spf.privateemail.com
Titan Email: include:spf.titan.email
OVHcloud: include:mx.ovh.com
Rackspace Email: include:emailsrvr.com

Apps and sending services that do need an include:

Mailgun: include:mailgun.org (on the domain you added in Mailgun)
Mailjet: include:spf.mailjet.com
Zendesk: include:mail.zendesk.com
Freshdesk: include:email.freshdesk.com
Salesforce: include:_spf.salesforce.com
Elastic Email: include:_spf.elasticemail.com

Common SPF mistakes

What breaks SPF, and how to avoid it.

Two SPF records

Publishing a second record for a new tool makes SPF fail with a permanent error. Merge everything into one record.

More than 10 DNS lookups

Every include, a, mx, ptr, exists and redirect counts, including nested ones. Remove tools you no longer use and avoid includes that are not needed.

Useless includes

Adding includes for services that use their own return-path domain, such as SendGrid or Mailchimp, uses lookups without helping DMARC.

Hard fail too early

Switching to -all before every sender is listed can send your own emails to spam or get them rejected.

Wrong region or plan

IONOS, Zoho and Microsoft government clouds use different values. Pick the variant that matches your account.

Using +all

+all authorizes every server on the internet to send as your domain. Never publish it.

How to add the SPF record in your DNS host

Open the DNS settings of your domain and look for an existing TXT record that starts with v=spf1. If there is one, edit it and add the new include before the final all. If there is none, create a TXT record at the root of the domain (@ or empty name, depending on the DNS host) and paste the generated value.

Save, wait a few minutes, then run the SPF checker. It should find exactly one record.

Cloudflare, GoDaddy, Namecheap and most DNS hosts:

Type: TXT
Name / Host: @
Value: v=spf1 include:_spf.google.com ~all
TTL: default or 1 hour

Reading your generator result

What each result means and what to do next.

SPF is only one third of the job

Check that SPF, DKIM and DMARC all pass for your domain, in one free test.

SPF Generator FAQ

Creating an SPF record

How do I create an SPF record?
Pick your email provider in the mailX SPF generator, choose soft fail (~all) or hard fail (-all), and copy the TXT record it returns into your DNS, at the root of your domain.
What is the SPF record for Google Workspace?
v=spf1 include:_spf.google.com ~all. If other services also send as your domain, add their includes in the same record.
What is the SPF record for Microsoft 365?
v=spf1 include:spf.protection.outlook.com ~all. GCC High, DoD and 21Vianet (China) tenants use different values, shown in the generator notes.

Several senders

How do I add several email providers to SPF?
Keep one record and put every include in it, for example v=spf1 include:_spf.google.com include:spf.mailjet.com ~all. Never create a second SPF record.
Why does the generator say no SPF record is needed?
Some services, such as SendGrid, Mailchimp, Postmark or Amazon SES, pass SPF on their own return-path subdomain. An include on your root domain would not help DMARC and would use DNS lookups. Set up their domain authentication records instead.

Policy

Should I use ~all or -all?
Start with ~all (soft fail) while you check that every legitimate sender passes. Move to -all (hard fail) once you are sure. With DMARC at enforcement, both work.
What is the 10 DNS lookup limit?
SPF evaluation may not need more than 10 DNS lookups. Each include, a, mx, ptr, exists and redirect counts, including those nested inside includes. Above 10, SPF fails with a permanent error.

Troubleshooting

Why does my SPF check fail after adding the record?
Usual causes: a second SPF record left in the DNS, a typo in the include, the record added on the wrong name, or more than 10 DNS lookups. Run the SPF checker to see what is published.
Can I have two SPF records?
No. Two SPF records on the same name make SPF fail. Merge them into one.