
Multiple SPF records on one domain break SPF for every message that domain sends. The standard allows exactly 1 record that starts with v=spf1 per domain name, and a receiver that finds 2 returns a permanent error, written permerror, without reading either one. The fix is to merge them into a single record that lists every sender, then delete the extra.
The fault is easy to create and hard to notice. Mail keeps sending, the DNS host accepts both records, and nothing bounces at first. This guide shows how to find the duplicate, merge it safely and confirm the result.
What happens when a domain has multiple SPF records?
SPF returns permerror for every message, whichever server sent it. The receiver does not pick the better record or combine the two. It stops as soon as it finds more than 1.
SPF is the DNS record that lists the servers allowed to send mail for a domain. It is defined in RFC 7208, and two sections of that document settle the question:
| Section | What it says |
|---|---|
| 3.2 | A domain name must not have multiple records that would cause a check to select more than one |
| 4.5 | If more than 1 record starting with v=spf1 is found, the check produces permerror |
| 4.5 | If 0 records are found, the result is none |
| 2.6.7 | A permerror means the published records could not be correctly interpreted |
An SPF permerror is not a fail in the strict sense, but it is never a pass. The same RFC says the result needs the DNS operator to step in before it can clear, so waiting does not help.
A failing message shows it in the Authentication-Results header:
Authentication-Results: mx.google.com;
dkim=pass header.i=@example.com header.s=k1;
spf=permerror smtp.mailfrom=example.com;
dmarc=pass (p=NONE) header.from=example.com
Here DKIM saved the message. DMARC needs only 1 aligned pass, and DKIM supplied it. Where a sender has no DKIM signature for your domain, the same fault produces a DMARC fail as well.
How do you check whether you have more than one?
Query the TXT records of the domain and count the lines that start with v=spf1. Anything above 1 is the fault.
From a terminal:
$ dig +short TXT example.com
"v=spf1 include:_spf.google.com ~all"
"v=spf1 include:sendgrid.net ~all"
"google-site-verification=abc123example"
This domain has 3 TXT records and 2 of them are SPF. The third is a site verification record and plays no part.
The SPF record checker does the same lookup and flags a duplicate. Check the exact name mail is sent from. SPF is read on the envelope sender's domain, so example.com and mail.example.com are 2 separate names, each with its own record.
What does not count as a duplicate?
Only 2 or more TXT records beginning with v=spf1 on the same name count. Several things look like the fault and are harmless.
| What you see | A duplicate? | Why |
|---|---|---|
Many TXT records, 1 starting with v=spf1 |
No | Verification and other TXT records are ignored by SPF |
1 SPF record on example.com, 1 on mail.example.com |
No | Each name is checked on its own |
| 1 record shown as 2 quoted strings | No | The strings are joined into 1 record |
A DMARC record at _dmarc.example.com |
No | A different name, read only by DMARC |
2 records starting with v=spf1 on example.com |
Yes | The check returns permerror |
The split record deserves a closer look, because DNS tools print it in a way that resembles 2 records. A single string inside a TXT record holds at most 255 characters, so a long record is stored as several strings. Section 3.3 of RFC 7208 says receivers must join them with no space added.
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com include:sendgrid.net " "ip4:203.0.113.0/24 ~all"
That is 1 record with 1 v=spf1, and it is valid.
Why do duplicates appear in the first place?
Duplicates appear because every sending tool's setup guide says to add an SPF record, and DNS hosts allow any number of TXT records on a name. Each instruction is correct alone and wrong together.
There are 4 usual routes:
- A second tool is added. The domain already has a record for its mailbox provider. The new marketing or CRM tool says "add this TXT record", and someone adds it as a new line.
- A migration leaves the old record behind. The business moves from one mailbox provider to another, publishes the new record and never removes the old one.
- Two people manage DNS. An agency adds a record for its tool without reading what is already there.
- A DNS host's wizard adds one. Some hosts create a default SPF record when email is turned on, next to the one you published.
There is also an older leftover. Early SPF had its own DNS record type, and RFC 7208 section 3.1 says that use was discontinued and records are published as TXT only. If your DNS panel still shows an entry of type SPF, remove it and keep the TXT record.
How do you merge them into one record?
Take every sender from both records, put them in 1 record with a single v=spf1 at the start and a single all at the end, publish it, and delete the others. The order of work matters, so follow the steps.
- Copy both records somewhere safe. You want the exact text if you need to go back.
- List every mechanism from each. A mechanism is one entry in the record, such as
include:,ip4:,aormx. - Remove senders you no longer use. A merge is the moment to drop a tool that was cancelled 2 years ago.
- Write one record. One
v=spf1, then each mechanism once, then one ending. - Edit one existing record to the merged value, then delete the other. Do both in the same session, so the domain is never left with 0 records or 2.
Before:
example.com. TXT "v=spf1 include:_spf.google.com ~all"
example.com. TXT "v=spf1 include:sendgrid.net ip4:203.0.113.25 -all"
After:
example.com. TXT "v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.25 ~all"
Two details cause most broken merges. The first is pasting one record after the other with both v=spf1 tags and both all endings kept. Everything after the first all is ignored, so the second half of such a record does nothing.
The second is the ending. If one record ended in ~all, a soft fail, and the other in -all, a hard fail, you have to choose. Use ~all unless you are sure the merged list is complete. Our guide to SPF, DKIM and DMARC explains what each ending does.
What if the merged record needs more than 10 lookups?
The merged record then fails for a different reason, with the same permerror result. Merging adds the lookups of both records together, and the SPF lookup limit is 10.
Section 4.6.4 of RFC 7208 counts these terms toward the limit: include, a, mx, ptr, exists and redirect. Lookups nested inside an include count too. The ip4, ip6 and all terms cost nothing.
| Term in the record | Costs a DNS lookup? |
|---|---|
include:_spf.google.com |
Yes, plus any includes nested inside it |
a and mx |
Yes, 1 each |
exists: and redirect= |
Yes, 1 each |
ip4:203.0.113.25 |
No |
ip6:2001:db8::/32 |
No |
~all or -all |
No |
The same section sets a second limit that is less well known. A receiver should allow at most 2 void lookups, meaning lookups that return no answer, so an include that points at a deleted hostname can break the record too.
If the count passes 10, there are 3 repairs, safest first:
- Remove includes for tools that no longer send. This alone often brings the count under 10.
- Replace
aormxwith the IP address when the server's address is fixed, sinceip4costs nothing. - Move a sender to a subdomain. A tool that sends as
news.example.comreads that subdomain's record, with its own budget of 10.
Copying a provider's IP ranges into your record by hand is the repair to treat with care. Providers change their ranges without notice, and a copied list goes stale silently.
Keep the record short as well. Section 3.4 of the RFC says a reply should fit within 512 octets, and that a record under 450 octets ought to fit in a single UDP packet.
What do Google, Yahoo and Microsoft expect?
All three ask senders to authenticate with SPF or DKIM, and a permanent error removes SPF from that count. As of November 25, 2026, these are the published positions.
| Provider | What it publishes | Source |
|---|---|---|
| Microsoft | Only 1 SPF record is allowed per domain or subdomain, and more than 1 causes SPF to return permerror |
Set up SPF for Microsoft 365 |
| Senders of close to 5,000 messages a day to personal Gmail accounts need both SPF and DKIM | Email sender guidelines FAQ | |
| Yahoo | All senders need SPF or DKIM at a minimum, and bulk senders need both | Sender Best Practices |
Microsoft's page also gives the record for a domain that sends through Microsoft 365 only: v=spf1 include:spf.protection.outlook.com -all. If you find that record next to a second one, the merge steps above apply unchanged.
The practical reading is this. A domain that relies on SPF alone has no passing authentication while the duplicate stands. A domain with aligned DKIM keeps passing DMARC, but it has lost its second route, and a bulk sender no longer meets the "both" rule.
How do you confirm the fix, and how long does it take?
Run the lookup again, then send a test message and read its header. The change is live for a receiver as soon as its cached copy of the old answer expires.
That delay is set by the TTL on the record, the number of seconds a resolver may keep an answer. A TTL of 3600 means up to 1 hour. Lowering the TTL to 300 before you edit shortens the wait to 5 minutes.
After the merge, the lookup returns 1 SPF line:
$ dig +short TXT example.com
"v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.25 ~all"
"google-site-verification=abc123example"
A test message then shows spf=pass where it showed spf=permerror. Send one test from each tool in the record, because a pass for your mailbox provider says nothing about the marketing tool.
Then check the rest of the domain. The free email deliverability test reads SPF, DKIM and DMARC together, and the DMARC checker shows whether you receive the reports that would have revealed the fault.
How do we find and repair this on a client domain?
We check every name that sends mail, not only the main domain. A business with several domains and subdomains usually has the fault on one that nobody looks at.
The order we work in:
- We pull the TXT records for every sending domain and subdomain and count the SPF lines on each.
- We ask which tools the business still uses. Each include is matched to a live tool or removed.
- We count lookups on the merged record before publishing it, so one permanent error is not swapped for another.
- We publish, then pull a header from each sender to see
spf=passfor the right domain. - We check the DMARC reports the next day for any source that stopped passing.
On one engagement in our case studies, the share of domains passing authentication checks measured 57% before the work and 99% after it. That work standardized the SPF, DKIM and DMARC configurations across every domain, and a per-domain count of SPF records belongs in that step.
One fixed record is not the end of it. The fault returns the next time someone follows a setup guide to the letter, so the lasting repair is a written list of every tool that sends as the domain and one person who owns the record.
Drafted with AI assistance from our own records and client work, then reviewed and approved by Kunal Arora. See our editorial policy.