SPF Record Generator

Build a valid SPF TXT record from includes, IP addresses, and an all mechanism.

SPF options
One per line or comma separated. include: is added automatically.
TXT record value
v=spf1 include:_spf.google.com -all

Publish as a TXT record on your domain root (v=spf1 … → TXT record at your domain root (@)). Use Email Health to verify after DNS propagates.

About the SPF Record Generator

The SPF Record Generator builds a syntactically valid SPF TXT record from the senders you authorize: third party includes (Google, SendGrid, Microsoft), explicit IPv4 and IPv6 addresses, optional a and mx mechanisms, and a closing all policy. The output updates live as you edit the form.

SPF tells receiving mail servers which hosts may send email for your domain. You publish one TXT record at the domain root. Getting the includes and the final -all or ~all mechanism right is the most common fix when legitimate mail passes but spoofed mail should not.

Everything runs in your browser. The record is assembled locally and is never uploaded. After you add the TXT record in DNS, use the Email Health tool to confirm it is visible and read the plain English notes on your policy.

SPF has a ten DNS lookup limit when receivers evaluate includes and redirects. Keep the include list focused on providers you actually use. Remove unused entries to stay under the limit.

Your ad could be here

Reach developers and designers who use these tools every day. Privacy-first, no trackers.

Frequently asked questions

Where do I publish the SPF record?

Add a TXT record at the root of your domain (the @ or apex host in your DNS panel). The value is the generated string starting with v=spf1.

Should I use -all or ~all?

-all (hard fail) is recommended for production domains once you are confident every legitimate sender is listed. ~all (soft fail) is a gentler transition while you audit senders.

How do I add Google Workspace or Microsoft 365?

Add their include host to the includes field. Google commonly uses include:_spf.google.com. Microsoft often uses include:spf.protection.outlook.com. Check your provider's current documentation.

Is this uploaded to a server?

No. The record is built entirely in your browser.

Can I have more than one SPF record?

No. Only one TXT record starting with v=spf1 is allowed per domain. Merge all senders into a single record using includes and ip mechanisms.