SPF builder

Build an SPF record from the services that send your mail, or check one you already have, with its lookup count.

Needed for the a and mx options, and to count lookups as receivers do.

What do you want to do?
Build a new record
Mailbox provider

Where people read your mail. Tick every service that sends as your domain.

Sending services

Addresses or ranges, one per line, such as 192.0.2.0/24.

Addresses or ranges, one per line, such as 2001:db8::/32.

For services not listed above, one per line, as their setup guide gives them.

Check a record I already have

Paste the TXT value that starts with v=spf1. Not sure what yours is? The SPF checker looks it up.

Free: no account needed and nothing is charged.

What the builder does

An SPF record is one TXT record at the root of your domain that lists every server allowed to send email as your domain. Getting it right by hand is fiddly: each mail service has its own include, the order and spacing matter, and the whole record must stay within 10 DNS lookups. This builder writes the record for you from a list of the services you use, and checks it the way a receiving mail server would before you publish anything.

It also works the other way round. Choose Check a record I already have, paste your current record, and the builder tells you whether it is valid, how many lookups it needs and what to change.

Building a record

  1. Enter your domain. It is optional, but it lets the builder count lookups exactly and is needed for the a and mx options.
  2. Tick your mailbox provider, such as Google Workspace or Microsoft 365, and every sending service you use for newsletters, invoices or support tickets.
  3. Add any other servers by IP address, one per line, or other include domains from a provider's setup guide.
  4. Choose what happens to everyone else. Start with ~all, which marks other senders as suspicious, and move to -all once your DMARC reports show all your real mail passes.

The record updates as you go. When it is ready, copy the name and value into your DNS host, or paste the zone file line if your host takes those.

The 10-lookup limit

Receivers allow an SPF check at most 10 DNS lookups. Every include, a, mx, ptr, exists and redirect costs one, including the ones inside the records you include. Google Workspace's include uses four lookups on its own. Go over 10 and receivers stop with an error, which fails SPF for all your mail.

The builder expands every include, shows the count on a meter and lists the whole include tree, so you can see which service costs the most. If you are over the limit, the usual fixes are to drop services you no longer use, list a service's fixed IP addresses instead of its include when you control them, or move newsletters to a subdomain with its own SPF record.

We don't generate flattened records, which copy your providers' addresses into your own record. Providers change those addresses without notice, and a flattened copy then breaks silently.

Long records

A TXT string holds at most 255 bytes, so a long SPF record is stored as several strings that receivers join together. The builder shows the split and writes the zone file line with each string quoted. Records over 450 bytes get a warning, because some receivers handle very long answers badly; trimming unused senders is the cure.

Checking a record you already have

Paste the record and the builder checks it like the email audit checks a published one: syntax errors, more than one all, a dangerous +all or a neutral ?all ending, the ptr mechanism, IP ranges so wide they include other people's servers, too many lookups, and lookups that find nothing. A pasted record is never refused as invalid input; its problems are listed as findings with step-by-step fixes.

To see the record your domain publishes today, run the SPF checker. From its result, Check and edit this record in the SPF builder brings the record here for you.

What the result gives you

The result shows the record's name (the root of your domain), its type, and its value, each with a copy button, plus a zone file line for DNS hosts that take those. Under it come the lookup count on a meter, the include tree, and any findings, worst first, each with a short fix and a link to a step-by-step guide. The builder never publishes anything for you and doesn't keep what you entered.

Next steps

SPF on its own decides little. Pair it with DKIM and a DMARC policy from the DMARC builder, then run the full email check to see the whole setup graded.

Questions

Do I need an account?
No. The builder is free with or without an account and needs no browser check. Through the API it is free with any key.
Why don't you offer a flattened record?
Flattening copies your providers' current IP addresses into your record to save lookups. Providers change those addresses without notice, and a flattened record then rejects your own mail without any warning. We show which includes cost the most so you can trim them instead.
My provider isn't in the list. What do I enter?
Add its include domain under Other include domains, exactly as its setup guide gives it, or list its sending IP addresses as IPv4 or IPv6 senders.
Can I add the record myself, or do you change my DNS?
We never touch your DNS. Copy the name and value, or the zone file line, into your DNS host. The result shows exactly where the record goes.