EmailAudit.io

SPF Record Generator

Select your email providers, add any custom senders, and choose an enforcement level. Your SPF record updates in real time.

Select every service that sends email on behalf of your domain.

Add include: mechanisms for providers not listed above. Enter the SPF domain only (e.g. _spf.yourprovider.com).

Add ip4: or ip6: ranges for servers sending mail directly (e.g. 203.0.113.1 or 2001:db8::/32).

Generated Record· updates as you type
v=spf1 -all

DNS Instructions

  • • Record type: TXT
  • • Host / Name: @ (root domain)
  • • TTL: 3600 (1 hour)
  • • Only one SPF record per domain is allowed — replace any existing one, do not add a second.
Verify with SPF Checker

What this generator builds

The generator assembles one SPF record from your choices: v=spf1, then an include: term for each provider you tick, each custom include you add, and each IP address you enter, then the all mechanism you select. Addresses containing a colon become ip6:, everything else becomes ip4:. The output is a TXT value you publish at the root of your domain (host @).

It builds a new record from scratch and does not read your existing DNS. If you already have an SPF record, copy its mechanisms into the generator before publishing, otherwise you will drop senders that currently work.

How to use it

  1. List every service that sends email as your domain, not just your mailbox provider: marketing platform, CRM, invoicing, helpdesk, website form plugin, monitoring alerts.
  2. Tick the providers you use. For anything not listed, add the include domain from that provider's own SPF documentation under Custom Includes.
  3. Add any servers you run yourself as ip4 or ip6 addresses or CIDR ranges, for example 203.0.113.0/24.
  4. Choose the enforcement level. Use ~all while you are still confirming the sender list, then -all once you are sure.
  5. Copy the record and publish it as a single TXT record at @. If a v=spf1 record already exists, replace it. Never add a second one.
  6. Wait for the TTL to expire, then verify the result with the SPF checker.

Choosing the all mechanism

EndingInstruction to receiversUse when
-allFail. Mail from other sources should be rejected or treated as failing.Your sender list is complete and verified.
~allSoftfail. Accept but treat as suspicious.Rollout stage, or when you cannot yet prove the list is complete.
?allNeutral. No assertion.Rarely useful. Our SPF checker reports it as a failure.
+allPass. Any server may send as you.Never. It removes the protection SPF exists to provide.

Once DMARC is in place, receivers generally act on your DMARC policy rather than on SPF's own fail or softfail result, so the practical difference between -all and ~all is smaller than it used to be. -all remains the clearest statement of intent.

Provider notes

These are the include values the generator uses for its built-in providers. Confirm them against the provider's current documentation before publishing, because providers occasionally change them.

ProviderSPF includeNotes
Google Workspace_spf.google.comGoogle's record nests further includes, so it costs several lookups, not one. Count it as roughly four and verify with the checker.
Microsoft 365spf.protection.outlook.comNeeded for Exchange Online mail. DKIM for Microsoft 365 is a separate setup using two CNAME records.
Mailchimpservers.mcsv.netMailchimp also asks you to authenticate your domain with DKIM from its dashboard.
SendGridsendgrid.netIf you complete SendGrid's domain authentication, it publishes CNAME records for DKIM and a return-path subdomain, so a root include may not be needed. Follow what your dashboard shows.
Postmarkspf.mtasv.netPostmark's own setup also gives you a DKIM record and a Return-Path CNAME.
HubSpot, Salesforce, Zoho Mailas shown in the toolCheck each provider's current help article. Many sending platforms rely mainly on DKIM and a custom return-path rather than a root-domain include.

The 10-lookup limit and what the counter shows

RFC 7208 allows at most 10 DNS-querying terms (include, a, mx, ptr, exists, redirect) in one evaluation, counting those inside every included record. Going over causes a permanent error and SPF fails for every message.

The counter under the provider buttons is deliberately simple: it counts only the providers you tick plus your custom includes. It does not look inside those records, so the real total is higher. Treat the counter as a lower bound, publish the record, then run the SPF checker, which expands each include and reports the actual total.

Best practices

  • Publish exactly one SPF record per domain. Two records produce a permanent error.
  • Add only services that send as your domain. Each unnecessary include spends part of a ten-lookup budget.
  • Prefer ip4 and ip6 for servers you control, since they cost no lookups.
  • Send high-volume or third-party mail from a subdomain such as mail.yourdomain.com with its own SPF record, which keeps the root record small.
  • Keep the record in a single TXT entry. If it exceeds 255 characters, your DNS provider splits the value into several quoted strings, which receivers join back together. That is valid, but check the result renders as one record.
  • Re-run the checker whenever you add or remove a sending service.

Limitations of this generator

  • It only produces include, ip4, ip6 and all terms. It does not generate a, mx, exists, redirect or exp mechanisms.
  • It does not validate IP addresses, CIDR ranges or custom include domains, so a typo is copied straight into the record.
  • The provider list is fixed at eight services. Custom includes cover everything else, but sourcing the correct value is your responsibility.
  • It cannot know which services your organisation actually uses. A missing include means that provider's mail will fail SPF.
  • SPF alone does not protect a domain. Pair it with DKIM and DMARC.

Related tools and guides

Frequently Asked Questions

What is an SPF record and why do I need one?

An SPF (Sender Policy Framework) record is a DNS TXT record that specifies which mail servers are authorised to send email on behalf of your domain. Without a valid SPF record, your emails may be rejected or marked as spam, and your domain is easier to spoof in phishing attacks.

What does -all vs ~all mean in an SPF record?

-all (hard fail) tells receiving mail servers to reject email from any server not listed in the SPF record. ~all (soft fail) marks it as suspicious but still delivers it. -all is recommended for production once you have confirmed all legitimate sending sources are listed. Use ~all only while testing.

How many DNS lookups is too many in an SPF record?

SPF has a hard limit of 10 DNS lookups per evaluation. Each include: mechanism counts as one lookup (plus any nested lookups it triggers). Exceeding 10 causes an SPF permanent error (permerror), meaning SPF fails regardless of your configuration. If you are close to the limit, consider SPF flattening — replacing include: mechanisms with direct IP addresses.

Can I have more than one SPF record?

No. Having multiple DNS TXT records starting with v=spf1 on the same domain causes an SPF permanent error. Only one SPF record is allowed per domain. If you need to authorise multiple sending services, combine them all into a single record.

How do I add a new email provider to my existing SPF record?

To add a new provider, edit your existing SPF record in your DNS settings and insert the provider's include: mechanism before the all mechanism at the end. For example, if you add HubSpot to an existing Google Workspace record: v=spf1 include:_spf.google.com include:_spf.hubspot.com -all. Check your updated lookup count stays under 10.