SPF Record Generator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free SPF record generator. Pick your email services, servers and IPs to build a valid SPF TXT record, with DNS lookups counted against the limit of 10.

Services that send email for you
SPF record (TXT)
Host / name
0
DNS lookups here
0
Length
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the SPF record generator

  1. Enter your domain, such as example.com.
  2. Tick the services that send email for you: Google Workspace, Microsoft 365, SendGrid, Amazon SES, Mailgun, Postmark, Zendesk or Shopify.
  3. Tick "mx" if your own mail servers send email, and "a" if your website's server sends email (for example, contact form notifications).
  4. Add any IPv4 or IPv6 addresses that send for you, and other include domains your providers give you.
  5. Choose the policy for mail from anywhere else: soft fail (~all), fail (-all) or neutral (?all).

The SPF record generator builds the TXT record, shows where to add it, counts the DNS lookups it uses and warns you about problems such as too many lookups or a record that's too long.

What SPF is

SPF (Sender Policy Framework) is a DNS record that lists which servers are allowed to send email for your domain. When a receiving server gets an email claiming to be from you, it checks your SPF record. If the sending server isn't on the list, the email may be marked as spam or rejected.

SPF helps:

  • Stop spoofing, where scammers send email pretending to be you.
  • Improve deliverability, because Gmail, Outlook, Yahoo and others trust authenticated mail more.
  • Meet sender requirements. Major mailbox providers now require SPF or DKIM for all senders, and both plus DMARC for bulk senders.

What an SPF record looks like

v=spf1 mx include:_spf.google.com ip4:203.0.113.5 ~all
  • v=spf1 says this is an SPF record. It must come first.
  • mx allows the servers in your domain's MX records.
  • a allows the server your domain name points to.
  • include: allows everything in another domain's SPF record, which is how email services are added.
  • ip4: and ip6: allow specific addresses or ranges (203.0.113.0/24).
  • ~all, -all or ?all says what to do with everything else. It must come last.

Include domains for common services

The SPF record generator adds these when you tick a service:

Service Include
Google Workspace _spf.google.com
Microsoft 365 spf.protection.outlook.com
SendGrid sendgrid.net
Amazon SES amazonses.com
Mailgun mailgun.org
Postmark spf.mtasv.net
Zendesk mail.zendesk.com
Shopify shops.shopify.com

Providers occasionally change their instructions, and some (especially newsletter and transactional services) authenticate with their own domain or rely on DKIM instead of your SPF. Always check your provider's current setup guide, and put any other include domains they give you in the "other include domains" box.

~all vs -all vs ?all

  • ~all (soft fail): mail from other servers is suspicious; it's usually accepted but may go to spam. The safe choice while you're setting up and checking that every real sender is listed.
  • -all (fail): mail from other servers should be rejected. The strictest option, for when you're confident the list is complete.
  • ?all (neutral): no policy. Rarely useful.

In practice, many receivers treat ~all and -all similarly, and rely on DMARC to decide what to do. Pairing SPF with a DMARC record is what really protects your domain. The DMARC record generator creates one.

The 10-lookup limit

SPF allows at most 10 DNS lookups to check a record. Each include, a, mx, ptr, exists and redirect counts as one, and the includes inside each provider's own record count too. Plain ip4 and ip6 don't count.

If the total goes over 10, the SPF check fails with a "permerror", and your mail may be treated as unauthenticated. The SPF record generator counts the lookups in your record and reminds you that each include adds more of its own. Google's include, for example, uses several lookups itself.

To stay under the limit:

  • Remove services you no longer use.
  • Replace a or mx with ip4 ranges if your servers have fixed addresses.
  • Ask providers if they offer a flatter include, or use a subdomain for marketing email with its own SPF record.

Only one SPF record

A domain must have exactly one SPF record. Two TXT records starting with v=spf1 make SPF fail. If you already have one, don't add a second: merge the new services into the existing record.

How to add the record

  1. Log in to your DNS provider (often your domain registrar, or a service like Cloudflare).
  2. Add a TXT record.
  3. Set the name/host to @ (the root domain). Some providers want the domain name itself, or a blank field.
  4. Paste the record as the value.
  5. Save, then wait for DNS to update. It's often minutes, but can take up to 48 hours.

If the record is longer than 255 characters, it has to be split into several quoted strings in the same TXT record. Many DNS panels do this automatically.

SPF, DKIM and DMARC together

  • SPF checks the sending server.
  • DKIM adds a cryptographic signature to each email, set up through your email provider.
  • DMARC tells receivers what to do when SPF and DKIM fail, and sends you reports.

All three together give the best protection and deliverability.

Tips

  • List every sender: your mailbox provider, newsletter tool, CRM, help desk, invoicing software, shop platform and website forms.
  • Start with ~all, watch for problems, then consider -all.
  • Test the record after publishing with your provider's checker or an SPF lookup tool.
  • Keep it tidy when you stop using a service.

Privacy and accuracy

Everything you enter stays in your browser. Nothing is uploaded or looked up. The SPF record generator builds the record by the SPF specification (RFC 7208), validates IP addresses and domain names, and counts the lookups in your record, with no AI involved. It can't see inside other domains' records, so the full lookup total may be higher than the count shown. Small business owners, IT admins and email marketers use it free.

Troubleshooting SPF failures

If emails fail SPF checks, the usual causes are:

  • A sender isn't listed. A newsletter tool, CRM or website form sending as your domain without being in the record. Check the email headers ("Received-SPF" or "Authentication-Results") of a failing message to see which server sent it.
  • Two SPF records. Merge them into one.
  • Too many lookups. Over 10 causes a permanent error.
  • Typos in include domains or IP addresses. The SPF record generator validates the format, but can't check that a domain is the right one.
  • Forwarding. When email is forwarded, the forwarding server isn't in your record, so SPF can fail even for legitimate mail. DKIM survives forwarding, which is one reason to set up DKIM as well.

SPF for domains that don't send email

Domains you own but never send email from (parked domains, old brand names) are easy targets for spoofing. Protect them with a record that allows nobody:

v=spf1 -all

Pair it with a DMARC record set to p=reject.

Quick reference

  • Mechanism: a part of the record that matches senders (a, mx, ip4, ip6, include).
  • Qualifier: what happens on a match (+ pass, ~ soft fail, - fail, ? neutral).
  • Permerror: a broken record, such as too many lookups.

Every record from the SPF record generator follows this structure.

Updating your record

Revisit your SPF record whenever you add or drop an email service, and regenerate it with the SPF record generator rather than editing by hand.

A worked example

A small accounting firm uses Google Workspace for staff email, Amazon SES for invoices sent from its billing software, and its website sends contact form notifications from a server at 203.0.113.5. The office manager ticks Google Workspace and Amazon SES, unticks mx (Google handles their mail), and adds 203.0.113.5 as an IPv4 address, keeping ~all.

The SPF record generator produces:

v=spf1 ip4:203.0.113.5 include:_spf.google.com include:amazonses.com ~all

It shows 2 DNS lookups in the record itself, well within the limit even after Google's own lookups. She adds it as a TXT record on @, replacing an old record that only listed Google, and a week later sets up DMARC.

Reach buyers while they are searching

Social posts reach people who follow you. Google Ads reaches people who are searching for what you sell, right now. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.

Frequently asked questions

What is an SPF record?

A DNS TXT record listing the servers allowed to send email for your domain. The SPF record generator builds one for you.

Where do I add the SPF record?

At your DNS provider, as a TXT record on the root domain (usually shown as @).

Can I have two SPF records?

No. Merge everything into one record; two records make SPF fail.

Should I use ~all or -all?

Start with ~all while you confirm every sender is listed, then consider -all. Add DMARC either way.

What is the SPF 10-lookup limit?

A record may need at most 10 DNS lookups, including those inside includes. Over that, SPF fails.

Is the SPF record generator free?

Yes, completely free, with no sign-up.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep