Part of the U-Suiteubuilder.aiusocials.aiusigs.aiucals.aiucards.ai
Home / Free tools / SPF record generator

SPF record generator

Which services send email as your domain?
Your SPF record
Type
TXT
Host / name
@ (your root domain)
Value
v=spf1 ~all

⚠ Pick at least one service. A record with nothing but “~all” says no one may send as you.

0 top-level DNS lookups. The limit is 10 in total, and each provider's include can add its own nested lookups.

Your domain must have only one SPF record. If you already have one, merge these entries into it instead of adding a second.

An SPF record generator builds the DNS text record that lists which services may send email for your domain. Tick your email providers, add any extra includes or IP addresses, choose ~all or -all, and this tool writes one TXT record for your root domain and counts its DNS lookups against the limit of 10.

How to use the spf record generator

  1. Tick each email provider that sends mail from your domain, such as your inbox provider and your marketing tool.
  2. Add any extra include values or IPv4/IPv6 addresses, separated by spaces, and tick mx or a if your own mail or web server sends mail.
  3. Choose ~all (soft fail) or -all (fail) for mail from anywhere else.
  4. Check the DNS lookup count and fix any warning about going over 10.
  5. Copy the record and add it as a TXT record for your root domain (@). Replace any existing SPF record rather than adding a second one.

How an SPF record is built

Every SPF record starts with v=spf1, lists the allowed senders, and ends with an all rule for everything else. include: points to another domain's SPF record, which is how email providers publish their sending servers. ip4: and ip6: list addresses directly. mx allows the servers in your domain's MX records, and a allows the server your domain's A record points to.

SPF has a hard limit: checking a record may need no more than 10 DNS lookups (RFC 7208). include, a, mx, ptr, exists and redirect each cost a lookup, and lookups inside included records count too. ip4, ip6 and all are free. Go over 10 and receivers return a permanent error, so SPF fails. The generator counts the lookups in your record and warns when you go over; remember that the providers' own records can add more.

~all asks receivers to treat other senders as suspicious, and -all asks them to fail them. Many providers suggest ~all while you are setting up, because DMARC decides the final action anyway.

Your domain must have only ONE SPF record. If you already have one, merge the new entries into it instead of adding another.

Worked example: You use Google Workspace for your inbox and SendGrid for newsletters, and your shop's server has the address 203.0.113.10. The record is: v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 ~all. Top-level lookups: 2 includes = 2. The ip4 entry and ~all cost nothing. Adding mx would make it 3, still well under 10, though the lookups inside Google's and SendGrid's records also count toward the limit.
SPF parts and whether they use a DNS lookup
PartExampleUses a lookup?
includeinclude:_spf.google.comYes, plus any lookups inside it
aaYes
mxmxYes
ip4ip4:203.0.113.10No
ip6ip6:2001:db8::1No
all~all or -allNo

Frequently asked questions

Can a domain have two SPF records?

No. RFC 7208 allows one SPF record per domain. With two or more, SPF returns an error for every message. Combine all your senders into one record.

Should I use ~all or -all?

~all (soft fail) is the safer choice while you are still finding all your senders. -all (fail) is stricter. If you have DMARC, your DMARC policy decides what actually happens to failing mail.

What happens if my SPF record has more than 10 lookups?

Receivers stop checking and return a permanent error, so SPF fails for all your mail. Remove services you no longer use, or replace includes with ip4 and ip6 entries where your provider supports that.

Where do I add the SPF record?

At your DNS host. Create a TXT record with the host @ (your root domain) and paste the value. Some hosts leave the host field blank for the root domain.

My email provider is not in the list. What do I enter?

Look up the include value in your provider's own help pages and add it in the extra includes box. Some services, such as many marketing tools, send from their own return-path domain and do not need to be in your root SPF record at all.

Related free tools

See all free email marketing tools →

Do this automatically in umails

umails writes your newsletter with AI, runs these checks before every send and sends from your own domain. Free for up to 500 contacts.

Start free