An SPF record is a DNS TXT record that lists the mail servers allowed to send email for your domain. For a cold email domain that sends only through Google Workspace, it can be as short as v=spf1 include:_spf.google.com ~all. Receiving servers check it on every message, so a broken record quietly weakens your authentication.

SPF is the simplest authentication record, which is exactly why it so often breaks: a second record added for a new tool, or an include that pushes the domain past the lookup limit. For how SPF fits with DKIM, DMARC and warm-up, see our cold email deliverability guide.

Key takeaways

  • Publish exactly one SPF record on each domain or subdomain that sends mail, because two records cause a permanent error.
  • Authorize only the services that really send as the domain, which for most cold email domains means one mailbox provider.
  • Keep SPF evaluation within 10 DNS lookups, counting every include, a, mx, ptr, exists and redirect, including nested ones.
  • End the record with ~all or -all, never +all, and let DMARC handle enforcement.
  • SPF checks the envelope sender, so it only helps DMARC when that domain matches your visible From domain.
  • Test with a DNS lookup and a real message after every change.

How SPF is checked

When your email arrives, the receiving server reads the domain in the envelope sender, also called the Return-Path or MAIL FROM address. It looks up that domain's TXT records, finds the one starting with v=spf1, and checks whether the connecting server's IP address matches any listed mechanism, reading left to right and stopping at the first match.

Result Meaning
pass The sending IP is authorized
fail The domain explicitly does not authorize this IP, for example through -all
softfail The domain says this IP is probably not authorized (~all)
neutral The domain makes no assertion (?all)
none No SPF record was found
permerror The record is broken, for example two records or too many lookups
temperror A temporary DNS problem prevented the check

Notice what SPF does not check: the From address your prospect sees. With a Google Workspace or Microsoft 365 mailbox, the envelope sender is normally your own address, so the two match. If an outreach tool sends through its own servers with its own Return-Path, SPF can pass for the tool's domain while doing nothing for yours. That matching step is called alignment, and our post on choosing a DMARC policy explains why it decides whether SPF counts.

Anatomy of an SPF record

Every record starts with v=spf1, lists one or more mechanisms and ends with an all mechanism. Three common versions:

Google Workspace only:   v=spf1 include:_spf.google.com ~all
Microsoft 365 only:      v=spf1 include:spf.protection.outlook.com ~all
Domain that never sends: v=spf1 -all

The building blocks you are most likely to meet:

  • include: authorizes another domain's SPF list, typically your mailbox provider.
  • ip4: and ip6: authorize specific addresses or ranges, with no DNS lookup.
  • a and mx: authorize the IPs behind the domain's A or MX records. Cold email domains rarely need them.
  • ptr: discouraged by the SPF specification as slow and unreliable. Do not use it.
  • all: matches everything not matched earlier, so it always goes last.

Each mechanism can carry a qualifier: + (pass, the default), - (fail), ~ (softfail) or ? (neutral).

Do not copy your main domain's record onto a cold email domain. A sending domain should authorize only what sends from it: usually the mailbox provider, plus the outreach tool only if it relays mail through its own servers. Our post on setting up cold email domains covers the rest of the DNS each domain needs.

Staying under the 10-lookup limit

The SPF specification caps evaluation at 10 terms that trigger DNS lookups: include, a, mx, ptr, exists and the redirect modifier. ip4, ip6 and all do not count. Nested lookups do: if your provider's include contains three more includes, that is four lookups, not one. Go over 10 and the result is permerror, which some receivers treat like a failure and which never counts as an SPF pass for DMARC.

The specification also recommends that receivers stop after two "void lookups," queries that return no record, and an include pointing at a domain with no SPF record produces a permanent error.

Ways to stay within the limit:

  1. Remove services that no longer send.
  2. Move other senders to subdomains. A newsletter platform can send from news.example.com with its own record, and each hostname gets its own lookup budget.
  3. Drop a and mx unless the servers behind them really send mail.
  4. Flatten with care. Replacing includes with raw IP ranges saves lookups, but providers change their IPs, and a stale flattened record fails silently.

Long records can also exceed the 255-character limit on a single TXT string. Split the value into several quoted strings inside the same record, which receivers join together. It never means creating a second record.

Choosing between ~all and -all

Both are legitimate. The real mistakes are +all, which authorizes every server on the internet, and ?all, which offers no protection.

Ending Result for unlisted senders Good fit
~all softfail Active sending domains protected by DMARC
-all fail Domains that send nothing, or tightly controlled senders
?all neutral Rarely useful
+all pass Never

Many deliverability practitioners prefer ~all on active sending domains. Once DMARC is in place, receivers base enforcement on your DMARC policy, which can still pass a forwarded message on an aligned DKIM signature even when SPF fails. Some receivers act on an SPF hard fail immediately, before DKIM or DMARC get a say, which is why -all is often reserved for domains that should never send.

Common SPF mistakes on cold email domains

  • Two SPF records. Adding a new record for a new tool instead of merging it into the existing one produces permerror.
  • Wrong host. The record belongs at the root (@) of the domain used in the envelope sender. Some DNS hosts append the domain automatically, so typing example.com in the host field creates example.com.example.com.
  • Assuming subdomains inherit. They do not. A subdomain that sends needs its own record.
  • Authorizing the wrong tool. If your outreach tool sends through your Google or Microsoft mailboxes, it needs no include of its own. Our comparison of Google Workspace and Microsoft 365 for cold email covers how each provider fits in.

How to test your SPF record

  1. Look it up. Run nslookup -type=txt example.com or dig +short txt example.com and confirm there is exactly one value starting with v=spf1.
  2. Count lookups. Use an SPF checker that expands every include and reports the total.
  3. Send a real message. From the actual mailbox, through the actual outreach tool, email a Gmail address. Open it, choose "Show original" and look for SPF: PASS with your domain. The Authentication-Results header should show spf=pass with smtp.mailfrom set to your domain.
  4. Repeat after changes, allowing for cached old values until their time-to-live expires.

Where to start

  • List every service that sends mail as the domain.
  • Write one record containing only those services, ending in ~all.
  • Count lookups and keep well under 10.
  • Publish it at the root as a TXT record and verify it with a real message.
  • Move on to DKIM setup, then DMARC.

If you would rather have authentication built and checked across every sending domain, our email deliverability setup service handles SPF, DKIM, DMARC and warm-up.

Frequently asked questions

Can a domain have two SPF records?

No. A domain must publish only one SPF record. If a receiver finds two TXT records starting with v=spf1, SPF returns a permanent error and the check cannot pass, which also removes SPF as a route to a DMARC pass. When you add a new sending service, merge its include into your existing record instead of creating a second one, and recount your DNS lookups afterward.

Does an SPF record stop cold emails going to spam?

Not on its own. SPF only tells receivers which servers may send for your domain. Inbox placement also depends on DKIM, DMARC alignment, domain and mailbox reputation, warm-up, volume, list quality and how recipients react. A correct SPF record is a baseline requirement: a missing or broken one hurts you, but a perfect one cannot make unwanted email welcome.

How long does a new SPF record take to work?

A new record is usually visible within minutes to a few hours, depending on your DNS host. When you change an existing record, resolvers may keep serving the old version until its time-to-live (TTL) expires, which can take longer. Check with a DNS lookup tool, then send a real test message and confirm SPF shows pass before you start warm-up.