Two SPF records on one domain: why both stop working, and how to merge them
You added a new provider’s SPF record next to the old one, and now receivers return permerror for every message, from both providers. Two SPF records on one name make SPF fail for every sender.
The short answer
A domain name can have only one SPF record. When a receiver finds two or more TXT records that start with v=spf1 on the same name, the SPF result is permerror, for every message and every sender [1]. Merge them into one record: one v=spf1, every mechanism from both, one all at the end.
What it looks like
In the headers of a delivered message, written by the receiving server in the Authentication-Results format of RFC 8601 [3]:
Authentication-Results: mx.example.net;
spf=permerror smtp.mailfrom=example.com
From the Python SPF library pyspf, whose source builds the message from 'SPF Permanent Error: ' and 'Two or more type TXT spf records found.' [5]:
From Gmail, when you send in bulk and your mail fails SPF [6]:
Why two SPF records break both
A receiver asks DNS for the TXT records on your domain, keeps the ones that start with exactly v=spf1, and throws the rest away [1]. If one is left, it evaluates it. If more than one is left, it stops and returns permerror without reading either [1]. RFC 7208 states the rule in section 3, “multiple SPF records are not permitted for the same owner name”, and again in section 3.2 [1]. Microsoft gives the same rule for Microsoft 365 domains: “only one SPF record is allowed per domain or subdomain” [4].
Nothing in the result tells the receiver which provider was meant, so mail from both fails. A permerror is no SPF pass, and DMARC only uses an SPF pass [2]. Until you merge, your mail passes DMARC only through an aligned DKIM signature [2].
How to find a duplicate SPF record
On macOS or Linux, list every TXT record on the name and count the ones that start with v=spf1:
dig +short TXT example.com
dig +short TXT example.com | grep -c 'v=spf1'
A count of 2 or more is the problem. On Windows, nslookup -type=TXT example.com returns the same records.
A typical result after adding Zendesk to a domain that uses Google Workspace, each with the record its setup guide shows [8][9]:
example.com. TXT "v=spf1 include:_spf.google.com ~all"
example.com. TXT "v=spf1 include:mail.zendesk.com -all"
Repeat the check on every name that sends mail, such as bounce.example.com. Each name has its own SPF record [1].
How to merge two SPF records
- Start a single record with
v=spf1. - Copy every mechanism from both records, in the order you want them tested:
ip4:,ip6:,include:,a,mx. Drop exact duplicates. - End with one
all. If one record ends in~all(softfail) and the other in-all(fail), pick one. Google recommends~all[8]. RFC 9989 warns that-allcan get a message rejected on SPF alone, before DMARC sees a valid DKIM signature [2]. - Publish the merged record and delete the old ones in the same change.
The example above, merged:
example.com. TXT "v=spf1 include:_spf.google.com include:mail.zendesk.com ~all"
This is the record Google lists for Google Workspace with Zendesk [8]. Zendesk shows the same merge, ending in -all [9]. It costs 2 DNS lookups, one per include, measured on 18 November 2026 [10]. Providers ask for this merge themselves: Cloudflare’s Email Routing setup says “If you have existing SPF records, merge them” and shows a record with both its include and Google’s [7].
After merging, count the lookups. More than 10 is a new permerror of its own: see SPF too many DNS lookups.
What is not a duplicate
- One record split into several strings.
"v=spf1 include:_spf.google.com " "include:mail.zendesk.com ~all"is one TXT record. Receivers join the strings without adding spaces [1]. Mind the space at the end of the first string. - Other TXT records on the same name. Site verification tokens and other TXT values do not start with
v=spf1, and receivers ignore them for SPF [1]. - SPF records on other names.
bounce.example.comandexample.comeach get one record, and they never conflict [1]. - The DMARC record. It lives at
_dmarc.example.comand starts withv=DMARC1[2].
Mistakes to avoid
- Pasting one record after the other in the same TXT value. In
v=spf1 include:_spf.google.com ~all v=spf1 include:mail.zendesk.com -all, receivers stop at the firstalland ignore every mechanism after it [1]. Zendesk’s include is never tested. - Leaving two
allterms. The same rule applies: the firstallends the record [1]. Put~allor-allonce, at the end. - Keeping
redirect=from both records.redirectmay appear only once in a record, or the result ispermerror[1]. A record that ends inallignoresredirectanyway [1]. - Publishing SPF as DNS record type “SPF”. Some DNS panels still offer it. SPF lives in TXT records only, and receivers query TXT only [1].
- Changing
~allto-allwhile merging. A receiver that checks SPF before DMARC can reject a message on a-allfail alone [2]. Change one thing at a time.
If you are merging because you are moving to a new provider, switching email providers without losing mail covers the order of the DNS changes. Once SPF passes again, moving DMARC from p=none to p=reject is what stops forged mail. More SPF problems are on the SPF record page.
Check for duplicate SPF records
The SPF checker reads every TXT record on the name in your browser, flags a second v=spf1 record and explains the fix.
Runs in your browser. Your domain is not sent to this site or stored.
See it on a test domain
Check these names under badmail.dev to see this in a result, without checking your own domain.
spf-three.badmail.dev: check it or see its records
Related guides
SPF permerror: too many DNS lookups, and how to get back to 10 or fewer
Your SPF record gets 10 DNS lookups. The eleventh turns the result into permerror. Count yours, find the costly includes and cut them without breaking mail.
From DMARC p=none to p=reject without blocking your own mail
Move DMARC from p=none to quarantine and then reject without losing real mail. What to fix first, how long to wait, and how t=y, pct and subdomains behave.
Change email provider without losing a single message
Move your domain to a new email provider without bounces. Set up the new SPF and DKIM first, lower the TTL, switch MX in one edit, then clean up the old ones.
