Skip to main content
InboxkitSign up free

Free tool

SPF record generator

Build a new SPF record for your domain. Add the IP addresses and email services that send for you, choose a policy, and copy a TXT record ready to publish. Already have a record? Look it up with the SPF checker. Testing a draft you wrote by hand? Paste it into the SPF syntax checker.

CONFIGURE RECORD

SPF record settings

Add IPv4 or IPv6 addresses that are authorized to send email from your domain

Include SPF records from email services like Google Workspace, Mailchimp, etc.

Include your domain's A or MX records as authorized senders

Define how to handle emails from unauthorized servers

Messages from unauthorized servers will be marked as suspicious but not rejected

Walkthrough

Watch: create an SPF record in under a minute

A 43-second walkthrough: add your server IPs, pick each service that sends for you, tick MX if your own mail servers send too, and choose a policy. Start with ~all while you confirm every sender is listed, then switch to -all. Publish one record at the root of your domain, because two SPF records break it.

How to use the SPF record generator

  1. Step 1

    Add your server IPs

    Under Authorized IP Addresses, enter each server or range that sends mail, such as 192.0.2.10 or 198.51.100.0/24. Leave it empty if you only send through hosted services.

  2. Step 2

    Add each sending service

    Under Third-party Email Services, enter the include domain only, without the include: prefix: _spf.google.com for Google Workspace, spf.protection.outlook.com for Microsoft 365.

  3. Step 3

    Tick A or MX only if needed

    Tick these only when the servers behind your domain's A or MX records send mail themselves. Each one costs a DNS lookup.

  4. Step 4

    Pick a policy and generate

    Choose ~all, -all or ?all, click Generate SPF Record, then copy the record and publish it as a TXT record.

What this SPF generator builds

The generator writes one SPF record in this order: the v=spf1 version tag, then a and mx if ticked, then an ip4: or ip6: mechanism for each address (an address containing a colon is treated as IPv6), then an include: for each service, and finally your policy. For a domain on Google Workspace with one server of its own, the output looks like this:

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

It builds the text only. It does not look up DNS, so it can't count how many lookups your includes trigger. Paste the result into the SPF syntax checker to count lookups before you publish, and look up the domain with the SPF checker once the record is live.

How to create an SPF record, step by step

  1. List every sender. Write down each service that sends email with your domain in the From address: your mailbox provider, your cold email or marketing platform, your CRM, your helpdesk, and any server of your own. A sender missing from the record fails SPF.
  2. Find each sender's include value. Google Workspace and Microsoft 365 use the values in the table below. Other platforms publish theirs on their DNS or domain authentication setup page. For your own servers, use ip4: or ip6: with the server's address.
  3. Choose the policy. Start with ~all while you confirm nothing legitimate is failing, then switch to -all.
  4. Stay under 10 DNS lookups. Every include, a, mx, ptr and exists costs a lookup, and so does every include inside an included record. Past 10, receivers return a permanent error and SPF fails. ip4 and ip6 cost nothing.
  5. Keep it to one record. If your domain already has a v=spf1 record, add the new senders to it. Two SPF records on the same domain break SPF for all of your mail.
  6. Publish and verify. Add the record as a TXT record at the root of your domain, wait for it to propagate, then check it with the SPF checker. The SPF setup guide covers the full process for a cold email domain.

SPF record examples

Domain sends fromSPF record
Google Workspacev=spf1 include:_spf.google.com ~all
Microsoft 365v=spf1 include:spf.protection.outlook.com ~all
Google Workspace and Microsoft 365v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
Google Workspace plus your own serverv=spf1 ip4:192.0.2.10 include:_spf.google.com ~all
Nothing (a parked domain)v=spf1 -all

~all vs -all: which SPF policy to choose

The all mechanism at the end of the record tells receivers what to do with mail from a server you didn't list. The generator offers three policies.

PolicyResult for unlisted serversWhen to use it
~allSoft fail: accept, but treat as suspiciousWhile you confirm every sender is in the record. The usual starting point.
-allFail: rejectOnce every legitimate sender passes. Also the right choice for a domain that sends no mail.
?allNeutral: no statement either wayRarely. It gives no protection against spoofing.

If mail you send is landing as a soft fail, the SPF softfail fix walks through finding the sender that is missing from the record.

Where to publish your SPF record

Add the record at the DNS host for your domain, usually your registrar or a DNS provider such as Cloudflare. The fields look like this at most providers:

FieldValue
TypeTXT
Host / Name@ (or blank, depending on the provider) for the root domain
ValueThe full record from the generator, starting with v=spf1
TTLThe provider default, or 3600
  • Publish one SPF record per domain. Edit the existing one rather than adding a second.
  • A subdomain that sends its own mail, such as mail.example.com, needs its own SPF record on that subdomain.
  • Use the TXT record type. The old SPF record type is no longer used by receivers.
  • SPF works alongside DKIM and DMARC; set up all three with the DKIM and DMARC generators below. The email authentication guide explains how they fit together.

FAQ

Frequently asked questions

List every service that sends email as your domain: your mailbox provider, your email platform, your CRM and any server of your own. Start the record with v=spf1, add an include: for each service and an ip4: or ip6: for each server, and end it with ~all or -all. Publish the result as a single TXT record at the root of your domain. This SPF record generator writes the record for you from those inputs.

Google Workspace uses include:_spf.google.com and Microsoft 365 uses include:spf.protection.outlook.com. A domain that sends from both lists both includes in the same record. Other email platforms publish their own include value on their DNS or domain authentication setup page; copy it exactly as they give it.

~all (soft fail) asks receivers to accept mail from unlisted servers but treat it as suspicious. -all (hard fail) asks them to reject it. Start with ~all while you confirm every sender is in the record, then move to -all once nothing legitimate is failing. Avoid ?all (neutral): it tells receivers nothing, so it gives no protection against spoofing.

No. A domain can publish only one TXT record that starts with v=spf1. If there are two, receivers return a permanent error and SPF fails for all of your mail. When you add a new sender, edit the existing record and add its include to it instead of creating a second record.

Receivers stop evaluating an SPF record after 10 DNS lookups and return a permanent error. The include, a, mx, ptr and exists mechanisms and the redirect modifier each cost a lookup, and so does every include inside an included record. ip4, ip6 and all cost nothing. If you are close to the limit, replace a and mx with the server IPs, and remove includes for services you no longer use.

At the DNS host for your domain, which is usually your registrar or a DNS provider such as Cloudflare. Create a TXT record, set the host or name to @ (or leave it blank, depending on the provider), paste the SPF record as the value, and save. If a subdomain sends its own mail, it needs its own SPF record on that subdomain.

Only if the servers behind your domain's A record or MX records actually send email. If your mail goes out through Google Workspace or Microsoft 365, their include already covers it, so a and mx only add DNS lookups. Leave both unticked unless you run your own mail or web server that sends.

Usually minutes, sometimes up to 48 hours, depending on your DNS provider and the TTL of any record you replaced. Once it has propagated, look up the domain with an SPF checker to confirm receivers see the record you published.

No. SPF is one of three authentication records. The other two are DKIM, which signs each message, and DMARC, which tells receivers what to do when SPF and DKIM fail. Gmail and Yahoo require all three from bulk senders, so set them up on every domain you send from. Content and sender reputation also decide inbox placement.

Automate your SPF management

Inboxkit automatically generates and manages SPF records for all your domains