// free tool, no signup

Free SPF Record Generator

Build a correct SPF record from your real sending sources: your own servers, the includes your email platforms publish, and specific IP ranges, with the right all policy and a live count of the 10 DNS lookups SPF allows. It runs free in your browser, with no signup and nothing stored.

policy for everyone else (the all mechanism)

Soft fail. Unlisted sources are marked suspicious but not rejected. A safe default while you confirm every sender.

SPF record is valid

// spf txt record (publish on your domain)
v=spf1 include:_spf.google.com ~all

Publish this as a single TXT record on your sending domain. A domain may have only one SPF record.

SPF record is valid 1 of 10 DNS lookups
  • SPF record Published pass
  • Single record Exactly one (required) pass
  • Policy ~all (softfail): recommended pass
  • DNS lookups 1 of 10 max pass
  • PTR mechanism Not used pass

Generated a record? Confirm it resolves with the SPF checker, then see where your mail lands with a free inbox placement test.

// what it is

What an SPF record generator does

An SPF (Sender Policy Framework) record is a single DNS TXT record that lists which servers may send email for your domain. This generator assembles that record from plain choices: your own a and mx hosts, the include mechanisms your email providers give you, and any fixed IP addresses, then closes it with the all qualifier that sets the policy for everyone else. As you build, it counts the DNS lookups your record will trigger, since SPF allows at most 10, and validates the result with the same checks as our SPF checker. Publish the output as one TXT record on your sending domain to help meet the Gmail, Yahoo, and Microsoft authentication requirements.

// reading the result

How to read your result

  • include: mechanisms

    Each platform you send through (Google Workspace, Microsoft 365, your ESP) publishes an include value such as _spf.google.com or sendgrid.net. Add one per line and the generator turns each into an include: mechanism.

  • a and mx

    Turn these on only if your domain's own web host (a) or mail servers (mx) also send mail. Each costs one of your 10 DNS lookups, so leave them off unless you really send from those hosts.

  • ip4 and ip6

    List any fixed IP addresses or CIDR ranges you send from directly. Unlike includes, ip4 and ip6 cost no DNS lookups, so prefer them for static sending IPs.

  • The all qualifier

    This sets the policy for sources not listed: -all hard fails unauthorized mail (recommended), ~all soft fails it (a safe default while you confirm every sender), and ?all is neutral. The generator never emits +all, which would authorize anyone.

  • DNS lookup count

    The live counter adds up the include, a, and mx mechanisms in your record. Stay at or under 10, or receivers return a PermError and SPF fails. Flatten or remove unused includes if you go over.

// common issues

Common problems and fixes

Going over the 10-lookup limit

Each include, a, and mx mechanism costs a DNS lookup, and nested includes add their own. Past 10, evaluation returns a PermError and SPF fails. Replace heavy includes with the specific ip4 ranges they cover, or drop providers you no longer use.

Publishing more than one SPF record

A domain may have only one TXT record that starts with v=spf1. If you send through several providers, combine them into one record with multiple include mechanisms rather than adding separate records.

Leaving off the all qualifier

Without a closing all mechanism the policy is incomplete and DMARC has nothing firm to align against. End the record with ~all while testing, then -all once every sender is confirmed.

Using includes for fixed IPs

If you send from a static IP, list it as ip4 or ip6 rather than wrapping it in an include. Direct IP mechanisms cost no lookups and keep you under the limit.

Authorizing the world with +all

Ending a record with +all tells receivers that any server may send as your domain, which disables SPF and invites spoofing. Use -all or ~all instead.

// FAQ

Questions, answered.

How do I create an SPF record?
List every service that sends mail for your domain, add each provider's include value and any fixed IP ranges, enable a or mx only if your own hosts send mail, then choose the all qualifier. The generator builds the v=spf1 record live and validates it. Publish the result as a single TXT record on your domain, then confirm it with the SPF checker.
Should the record end in ~all or -all?
Both set the policy for senders not in your record. -all is a hard fail and the recommended end state. ~all is a soft fail that flags unlisted mail without rejecting it, which is useful while you confirm every legitimate source. Avoid +all, which authorizes everyone.
How many DNS lookups can SPF use?
Ten, in total, across the whole include chain. include, a, mx, ptr, and exists each consume lookups; ip4, ip6, and all do not. The generator counts the mechanisms in your record so you can stay under the limit and avoid a PermError.
Can I have more than one SPF record?
No. A domain must publish exactly one v=spf1 TXT record. Merge multiple providers into that single record with several include mechanisms. A subdomain can carry its own SPF record, since SPF is not inherited from the root domain.
Where do I publish the record?
Add it as a TXT record on the domain you send from (the apex, or the subdomain in your Return-Path) in your DNS host's control panel. After it propagates, run a free deliverability check to confirm mail authenticates end to end.
// before you hit send

A clean record is step one. See where your email actually lands.