Skip to content
toolstome

SPF record generator

Build the SPF record that tells receiving mail servers which servers may send email for your domain. Tick your email services, such as Google Workspace or Microsoft 365, add your own servers’ IP addresses or ranges, choose how strictly receivers should treat other senders, and copy the record into a TXT record at your DNS host. The generator checks each entry, leaves out invalid ones, puts IP ranges first because they need no DNS lookups, and counts the lookups so you stay within the limit of 10.

Free · No sign-upProcessed in your browser
Your own servers
Email services

Mail from other servers

Host
@
Type
TXT
DNS lookups in this record
1 / 10

Publish exactly one SPF record per domain. If one exists, replace it rather than adding a second.

How to use the SPF Record Generator

  1. 1

    Choose your senders

    Tick mx if your incoming mail servers also send mail, and tick each email service you use.

  2. 2

    Add IP addresses

    List your own servers’ IPv4 and IPv6 addresses or CIDR ranges, one per line.

  3. 3

    Pick the policy

    ~all (softfail) is the safe start; -all (fail) once every sender is listed.

  4. 4

    Publish

    Create one TXT record at the root of your domain (host @) with the generated value.

When to use it

  • Set up SPF for a new domain that uses Google Workspace or Microsoft 365.
  • Add a newsletter or transactional email service to an existing SPF policy.
  • Replace two conflicting SPF records with one merged record.

Limits

  • Provider include names come from each provider’s setup guide; check your provider’s current documentation, since some use account- or region-specific names.
  • The lookup count covers this record only; each include adds its own nested lookups. Check the published record with the SPF checker.
  • A domain must have exactly one SPF record; merge any existing record into this one.

Privacy

The record is built in your browser. Nothing you enter is sent anywhere.

Frequently asked questions

What is the SPF 10-lookup limit?

Evaluating an SPF record may trigger at most 10 DNS lookups in total, counting include, a, mx, ptr, exists and redirect, including those inside included records. Past 10, receivers return permerror and SPF fails.

Should I use ~all or -all?

~all (softfail) asks receivers to accept but mark mail from other servers; -all (fail) asks them to reject it. Many providers recommend ~all while DMARC enforces the policy, or -all once you are sure every sender is listed.

Can a domain have two SPF records?

No. Two TXT records that start with v=spf1 make SPF return permerror. Merge them into one record.

Why is ptr discouraged?

RFC 7208 says ptr should not be used: it is slow, unreliable and puts load on the DNS of the sender’s IP owner. Use ip4, ip6 or include instead.

Does SPF stop spoofing on its own?

Only partly. SPF checks the hidden envelope sender, not the From address people see. DMARC ties SPF and DKIM to the visible From address and tells receivers what to do on failure.

What host name do I use?

Publish the record as a TXT record on the domain itself, usually written as @ or left blank at your DNS host. For a subdomain that sends mail, use the subdomain as the host.

People also use

Last updated November 22, 2026 · How we build and test our tools

Categories

Recently used tools

Tools you open will appear here.

More