free tools for text, SEO, developers, DNS and imagesEvery tool runs locally in your browser. No sign-up. Nothing is uploaded.

SPF Record Generator

Build a valid SPF record for your domain: add Google, Microsoft or Zoho, includes, IPs, a, mx, pick hard or soft fail. Free, no sign-up, and it runs in your browser.

Dedicated page: /en/spf-generator

Sending services you use (adds their include)

Report an Issue

Found a mistake or a problem with this tool? Tell us below.

We reply from [email protected]. If the form cannot send, your email app opens with your report ready to send.

Quick answer

An SPF record generator builds a Sender Policy Framework DNS record that lists which mail servers may send email for your domain. A correct SPF record, published as a TXT record at your root domain, reduces spoofing and helps Gmail, Yahoo and Outlook accept your mail.

About this SPF Record Generator

Build a valid SPF record for your domain: add Google, Microsoft or Zoho, includes, IPs, a, mx, pick hard or soft fail. It is one of the Security and DNS on ToolUstad, and like every tool here it runs entirely in your browser: nothing you type, paste or open is uploaded to a server, and there is no sign-up or usage limit.

What is SPF?

SPF, Sender Policy Framework (RFC 7208), is an email authentication protocol. You publish a DNS TXT record that begins v=spf1 and lists the mechanisms allowed to send for your domain: ip4 and ip6 addresses, a and mx lookups, and include statements that pull in a provider's own record, such as Google Workspace or Microsoft 365. The record ends with an all mechanism that tells receivers what to do with everything else: -all (hard fail) or ~all (soft fail). One record covers your whole domain, so list every sender that uses it before you publish the record.

The mechanisms you will actually use

MechanismMeaningExample
include:Trust another domain's SPF recordinclude:_spf.google.com
ip4: / ip6:A specific server address or rangeip4:203.0.113.10
a / mxThe domain's A record or mail serversmx
~allSoft fail anything not listedSafer while setting up
-allHard fail anything not listedRecommended once testing is done

Why SPF matters now

Since February 2024, Google and Yahoo require bulk senders to publish SPF and DKIM and to have a DMARC record, and enforcement has only tightened since. Without SPF, receivers cannot confirm your mail server is authorised, so messages land in spam or are rejected outright. SPF also stops the simplest form of spoofing, where a stranger sends mail claiming to be your domain from their own server.

Best practices

  • One SPF record per domain: two v=spf1 records invalidate both.
  • Watch the 10 DNS lookup limit: every include, a, mx and redirect costs lookups.
  • Start with ~all while you inventory every sender, then move to -all.
  • Include every legitimate sender: website host, helpdesk, CRM and marketing platform.

Common mistakes to avoid

  • Publishing SPF as the old SPF record type instead of TXT.
  • Forgetting the sending service you use once a quarter, like the invoicing tool.
  • Exceeding 10 lookups, which causes a permanent error (permerror) and fails all checks.
  • Editing the record and not waiting for DNS propagation before testing.

Who is the SPF generator for?

Domain owners setting up Google Workspace or Microsoft 365, marketers whose newsletters land in spam, and administrators cleaning up deliverability. Writing the record by hand is doable, but one wrong mechanism breaks authentication for the whole domain, while the generator assembles valid syntax and explains each choice as you make it.

A short worked example

A small business using Google Workspace and Mailchimp publishes one record: v=spf1 include:_spf.google.com include:servers.mcsv.net ~all. That single TXT record authorises Google's servers and Mailchimp's servers, soft fails everything else while they monitor, and costs only a handful of the 10 allowed DNS lookups. When a new helpdesk tool starts sending, its include is added to the same record, never as a second one. Build yours in the generator above with your own providers, publish it, then check it resolves with any DNS lookup tool before announcing the change.

Learn: how to use the SPF Record Generator

  1. Enter your domain and tick every service that sends email as that domain: Google Workspace, Microsoft 365, Zoho, or your own includes.
  2. Add any fixed sending IPs and pick a or mx only if your own servers send mail.
  3. Start with ~all (soft fail) while you test, then switch to -all (hard fail) once you are sure every sender is listed.

Features

  • One-click includes for Google Workspace, Microsoft 365 and Zoho Mail
  • Custom include, ip4 and ip6 lists, plus a and mx mechanisms
  • Strict (-all), soft fail (~all) and neutral (?all) endings with guidance
  • Ready-to-paste DNS TXT record with host and value
  • Per-mechanism explanation and the one-record and 10-lookup warnings

Worked example

Domain example.com using Google Workspace with a hard fail generates v=spf1 include:_spf.google.com -all, the most common SPF record on the internet.

Frequently asked questions

What happens if I publish two SPF records?

SPF fails entirely (a PermError) and receivers may treat your mail as unauthenticated. Always merge everything into a single TXT record that starts with v=spf1.

What is the 10 lookup limit?

SPF allows at most 10 DNS lookups while evaluating a record. Every include, a, mx and redirect costs lookups, and includes nest. Exceed 10 and SPF breaks, which is why this tool warns you.

Soft fail or hard fail to start?

Soft fail (~all) while you inventory your senders for a week or two, then hard fail (-all). Publishing -all before listing a real sender, like your invoicing tool, will get legitimate mail rejected.

Does SPF stop spoofing on its own?

SPF authenticates the sending server for the envelope domain. Pair it with DKIM and a DMARC record (use the DMARC generator here) for protection that covers the visible From address.

Where do I publish the SPF record?

As a DNS TXT record on your root domain (the @ host) with your registrar or DNS host. The value is the full record starting with v=spf1. Subdomains that send mail need their own records.

What is the 10 DNS lookup limit?

SPF evaluation may perform at most 10 DNS lookups caused by include, a, mx, ptr and redirect mechanisms. Exceed it and receivers return a permanent error, failing SPF entirely. Flattening services exist to compress long records.

Does SPF alone stop phishing with my domain?

SPF stops outsiders sending from unauthorised servers, but the check uses the envelope sender domain, which users never see. Pair SPF with DKIM and a DMARC policy to protect the visible From domain.

Related tools

More Security and DNS like this one, plus two picks from other categories. Each opens its own dedicated page.

See all tools
Copied