Skip to main content

SPF, DKIM and DMARC

Multiple SPF Records: Why Two Records Break SPF and How to Merge Them

By Tom Sather•Updated October 11, 2026•6 min read

A domain can have only one SPF record. Publish two and receivers return permerror, so SPF fails for all your mail. Here's how to merge them into one record.

On this page

A domain can have only one SPF record. If DNS returns two TXT records that start with v=spf1 for the same name, receivers don't pick one: the SPF spec says the result is a permanent error (permerror), and SPF fails. The fix is to merge everything into a single record with one v=spf1 at the start and one all at the end.

This one is easy to cause and easy to miss. Every sending service's setup guide says "add this SPF record," and if you follow two of them literally, you end up with two records. Nothing bounces right away, and the problem can sit there until DMARC enforcement or a provider's sender requirements make SPF matter.

What the spec says

RFC 7208, the SPF specification, is direct about it. Section 3.2: "A domain name MUST NOT have multiple records that would cause an authorization check to select more than one record." And section 4.5: "If the resultant record set includes more than one record, check_host() produces the 'permerror' result."

Microsoft's documentation says the same in plainer terms: multiple SPF TXT records for the same domain or subdomain "cause SPF to return permerror (the receiving system can't determine which record to evaluate)." Google's says "Each domain can have one SPF record, but the record can specify additional servers and third parties."

Permerror counts as an SPF failure for DMARC. If your DKIM is aligned, DMARC can still pass, but you've lost one of your two supports.

What counts as a duplicate (and what doesn't)

Only TXT records that start with v=spf1 count. These are fine together on the same name:

example.com.  TXT  "v=spf1 include:_spf.google.com ~all"
example.com.  TXT  "google-site-verification=abc123"
example.com.  TXT  "MS=ms12345678"

RFC 7208 discards any record that doesn't start with exactly v=spf1, so verification tokens and other TXT records don't interfere.

This is a duplicate:

example.com.  TXT  "v=spf1 include:_spf.google.com ~all"
example.com.  TXT  "v=spf1 include:spf.esp.example -all"

Two other situations look like duplicates but aren't:

  • Records on different hostnames. example.com and news.example.com each get their own SPF record. That's correct, and it's a good way to keep each domain under the 10-lookup limit.
  • One record split into several strings. A single TXT record can hold more than one quoted string, which DNS needs for anything over 255 characters. RFC 7208 says those strings are joined "without adding spaces," so "v=spf1 include:_spf.google.com " "include:spf.esp.example -all" is one record. Mind the space at the end of the first string.

How to merge two SPF records

  1. Find every SPF record. Run dig +short TXT example.com or use the SPF, DKIM and DMARC checker, which flags duplicates. Copy each v=spf1 record somewhere you can edit.
  2. List the mechanisms. Pull out every include:, ip4:, ip6:, a and mx term from all the records. Drop exact duplicates.
  3. Remove anything you no longer use. A merge is a good moment to retire the include for the platform you left two years ago.
  4. Pick one all. Each record ends with its own all qualifier, and you can only keep one. Use -all (fail) if you're confident every legitimate source is listed, or ~all (softfail) if you're not. The SPF record guide covers the difference.
  5. Build the merged record. One v=spf1 at the start, the mechanisms in the middle, all last. Anything after all is ignored.
  6. Count lookups. Merging adds up the DNS lookups from every include. Run the result through the SPF lookup counter before you publish. Two records that were each under 10 can be over 10 together, which trades one permerror for another.
  7. Publish the merged record and delete the old ones. Edit one of the existing records into the merged version and delete the other, rather than adding a third.

Using the duplicate example above, the merged record is:

example.com.  TXT  "v=spf1 include:_spf.google.com include:spf.esp.example ~all"
✨
If a merge pushes you over 10 lookups, check whether each service really needs to be in your root record. SPF checks the Return-Path domain, not the From domain, so a service that uses its own or a custom bounce domain doesn't need an include in your root SPF record at all.

Common mistakes when merging

  • Two v=spf1 tags in one record. "v=spf1 include:a.example v=spf1 include:b.example ~all" isn't a merge. It's a syntax error.
  • Two all terms. Evaluation stops at the first all, so everything after it is ignored. Only one belongs, at the end.
  • A missing space between strings. When a long record is split, the strings are joined with no space added, so "...include:a.example" "include:b.example..." becomes include:a.exampleinclude:b.example.
  • Using the old SPF record type. RFC 7208 says SPF records must be published as TXT. If your DNS console offers an "SPF" record type, don't use it.

How to confirm it's fixed

  1. Query DNS again and confirm exactly one v=spf1 record comes back. Changes can take time to appear depending on your TTL.
  2. Re-run the checker and lookup counter.
  3. Send a test message from each service in the record to a mailbox you control and check for spf=pass in the Authentication-Results header. The header analyzer makes this quick.
  4. If you have DMARC, watch your aggregate reports over the next few days. SPF results should go from failing across every source to passing.

How to keep it from coming back

Duplicates come from onboarding a new tool by following its setup guide literally. Two habits help:

  • Whoever owns DNS edits the existing SPF record rather than adding one. Make that the rule for every new sending service.
  • Keep a short note of which include belongs to which vendor and who owns it, so the next merge (or cleanup) is quick.

If SPF fails across every source at once, a duplicate record or a lookup-limit permerror is the most likely cause. SPF fail, softfail, permerror and temperror explains each result, and DMARC fail covers what happens downstream.

When to get help

If you're not sure which includes are still in use, or a merged record keeps coming out over 10 lookups, a quick review of the record is cheaper than breaking SPF for the whole domain.

FAQ

What happens if I have two SPF records?

Receivers return permerror, which is an SPF failure. Any mail that relies on SPF for DMARC fails DMARC too. Merge them into one.

Can I have an SPF record on my domain and another on a subdomain?

Yes. Each hostname gets its own record. Only two v=spf1 records on the same name are a problem.

Do other TXT records count as SPF records?

No. Only TXT records starting with v=spf1 are SPF records. Domain verification tokens and other TXT records can sit alongside it.

Should the merged record end in -all or ~all?

Use -all if you're confident every legitimate source is in the record, and ~all if you're still finding them. Under DMARC, the difference matters less than getting SPF and DKIM aligned.

Sources

Related guides

Still stuck?

Some deliverability problems take an experienced eye to untangle. Tell me what you're seeing and I'll tell you what I'd check first. The first 30-minute call is free.