Free tool

SPF
GENERATOR

Select the providers that send email on your behalf, add any servers of your own, and this assembles the SPF record for you. It counts the DNS lookups each include costs as you add them, because SPF silently stops working once a record needs more than ten, and that limit is the single most common reason SPF breaks.

Mail services0
Your own servers
IPv4, IPv6 and CIDR blocks cost no lookups. Hostnames use an a: mechanism and cost one each.
Enforcement
0 of 10 DNS lookups used.
DNS record
Host / nameyourdomain.com
TypeTXT
Value
v=spf1 ~all

Built in your browser, never sent anywhere. Publish the record, then confirm it resolves and evaluates the way you expect.

Check a published SPF record

What is an SPF Record Generator?

An SPF record generator is a free tool that builds the SPF TXT record listing every server allowed to send email as your domain. You pick the mail services you use and add any servers of your own, and it assembles a valid record while counting the DNS lookups against the limit of ten that silently breaks SPF when exceeded.

How does an SPF Record Generator work?

  1. 01Tick the mail services you use, such as Google Workspace, Microsoft 365, SendGrid or Mailgun.
  2. 02Add any additional sending servers by IP address or hostname.
  3. 03We build the record in the correct order and track the lookup count against the limit of ten.

Frequently asked questions

What is the ten DNS lookup limit?

Every include, a, mx, ptr and exists mechanism in an SPF record costs a DNS lookup when a receiving server evaluates it, and includes can nest to cost several. The spec caps this at ten. Go over and compliant receivers return permerror, which usually means your SPF is treated as absent. This tool counts as you build so you can see the ceiling coming.

Should the record end in ~all or -all?

The all mechanism decides what happens to mail from servers not listed. A soft fail (~all) marks unlisted mail as suspicious but still delivers it; a hard fail (-all) asks receivers to reject it. Start with ~all while you confirm you have listed every legitimate sender, then tighten to -all once the reports are clean.

Can I publish more than one SPF record?

No. A domain must have exactly one SPF TXT record. Publishing two is a permanent error and receivers will disregard both, which is a common outcome when a new mail service is added by pasting in a second record. Merge every sender into a single record with multiple include mechanisms instead.

Related tools

SPF Checker
Look up a domain’s SPF record, list the servers it authorises, and catch the errors that break email delivery.
DMARC Record Generator
Build a valid DMARC TXT record: choose the policy, reporting addresses and alignment, then copy the record straight into DNS.
DKIM Record Generator
Generate a DKIM key pair in your browser and get the DNS TXT record for your selector, plus the private key for your mail server.