Multiple SPF records: how to merge them into one
By Matt Pritchett · · Updated · 5 min read
You can't have multiple SPF records on one domain. Microsoft's SPF guide says only one SPF record is allowed per domain or subdomain, and the SPF standard, RFC 7208, says that if the record set includes more than one record, check_host() produces the "permerror" result. A permerror means SPF fails for every message, including the ones from senders listed correctly. The fix is to merge both records into one line that starts with v=spf1, lists every sender, and ends with a single all rule.
How a domain ends up with two SPF records
It usually happens when a new service is added. Your domain already has a record for Google Workspace or Microsoft 365. Then you set up a newsletter tool, a help desk, or an SMTP plugin for your WordPress site, and its setup screen tells you to add an SPF record. You add a new TXT record instead of editing the old one, and now there are two.
The new service often looks fine on its own setup screen, because it only checks that its own include is published. Mail starts failing elsewhere: order receipts, contact form entries, sometimes the mail your team sends from Gmail or Outlook.
How to tell if you have more than one
Look at the TXT records at the root of your domain (the @ or blank host) in your DNS provider. Count the ones whose value starts with v=spf1. Other TXT records, like a Google site verification string, don't count, and neither does a DKIM or DMARC record, since those live on their own host names. Two or more that start with v=spf1 is the problem.
A quicker way is to run your domain through the free email authentication check from DMARC Monitor. It reads your SPF, DKIM, DMARC, BIMI and MX records in one pass and gives a plain-English fix for each problem.
How to merge them
Say your DNS has these two records:
- v=spf1 include:_spf.google.com ~all
- v=spf1 include:servers.mcsv.net ~all
The first is Google Workspace. The second is Mailchimp. Merge them like this:
- Keep one v=spf1 at the start.
- Copy every include:, ip4: and ip6: from both records after it, separated by spaces.
- Keep one all rule at the end.
The result is the record Google itself lists for Google Workspace and Mailchimp:
v=spf1 include:_spf.google.com include:servers.mcsv.net ~all
Then edit one of the old TXT records so its value is the merged line, and delete the other. Editing in place is safer than deleting both and adding a new one, since there is no gap where your domain has no SPF record at all.
If the two records end differently
One record may end in ~all and the other in -all. Keep only one. Google says the ~all tag tells receiving servers to mark messages as spam if they're from servers that aren't listed in the SPF record, and Google recommends you use ~all. Microsoft's examples use -all, the strict version. If you aren't sure every sender is listed yet, use ~all and tighten it later.
Common merged records
These come from Google's SPF help page. Each keeps Google's include and adds the other service before the all rule:
- Google Workspace and Microsoft 365: v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
- Google Workspace and Amazon SES: v=spf1 include:_spf.google.com include:amazonses.com ~all
- Google Workspace and GoDaddy: v=spf1 include:_spf.google.com include:secureserver.net ~all
The same pattern works for any pair: one v=spf1, both includes, one all rule.
The WordPress case
A WordPress site sends its own mail: password resets, form entries, store receipts. When you connect it to an email service, that service gives you its SPF part to add. Add it to the record your inbox provider already uses. If you send WordPress mail through SendWP, SendWP gives you the exact records to add, copy-ready: a DKIM record and an SPF record. Take the include from the SPF one and put it in your existing line, before the all rule. If you'd rather tick boxes than edit text, the SPF record generator builds one merged record from the services you pick.
Watch the lookup count after merging
Merging fixes the permerror from two records, but a long merged record can hit a second limit. Microsoft says that if the number of DNS lookups is greater than 10, the message fails SPF with a permanent error. Each include costs at least one lookup, and Microsoft notes that having fewer than 10 include: statements doesn't guarantee fewer than 10 DNS lookups, because an include can point to more of its own. Before you add a service, remove the ones you no longer send from. The free SPF lookup counter counts every lookup in your record and shows which include costs the most.
Subdomains have their own record
The one-record rule is per name. Microsoft says the SPF TXT record for contoso.com doesn't cover marketing.contoso.com; marketing.contoso.com needs its own SPF TXT record. So a record on news.yourshop.com is not a duplicate of the one on yourshop.com. If a sender uses a subdomain, give that subdomain its own single record.
Check that it worked
Google says it can take up to 48 hours for SPF authentication to start working. After you save the merged record, run the free check again and confirm there is one SPF record and it passes.
The next time someone adds a tool and a second record, you want to know before your customers do. DMARC Monitor's monitoring rechecks every day and emails you only when something newly breaks.
Paste your domain into the free DMARC Monitor check now and see whether it has one SPF record or two.
Written by The DMARC Monitor Team, assisted by Friday.