Guides / Multiple SPF records: why two records break SPF and how to merge them
Multiple SPF records: why two records break SPF and how to merge them
You've updated DNS, waited, and your mail still lands in spam or fails SPF. One of the most common causes is also one of the easiest to miss: your domain has two SPF records instead of one. Each record can look perfectly fine on its own. Together they make SPF fail for every message you send.
Why two SPF records count as a failure
SPF is defined in RFC 7208. When a receiving server checks your domain, it looks up the TXT records and keeps the ones that start with v=spf1. The rule is strict: if more than one record remains, the result is permerror, a permanent error. The server doesn't pick one or combine them for you.
A PermError means SPF did not pass. For DMARC, that's the same as no SPF pass at all, so your mail now depends entirely on DKIM being set up and aligned. If DKIM isn't, DMARC fails too, and that's when you see spam placement or bounces like Gmail 550 5.7.26.
How a domain ends up with two
- Your domain host or registrar added a default SPF record when you set up email or a website, and you added another one for Google Workspace, Microsoft 365 or a sending tool.
- A sending tool's setup guide said to "add this SPF record", and you added it as a new record instead of editing the existing one.
- Support or a contractor changed DNS more than once and each change added a record.
- You moved email providers and the old provider's record was never removed.
How to check if you have duplicates
- Run your domain through the free checker. It reads your live SPF, and if there is more than one record it lists each one and suggests a single merged record you can copy.
- Or look it up yourself: run
nslookup -type=txt yourdomain.com(ordig txt yourdomain.com) and count the answers that start withv=spf1. Ignore other TXT records, such as Google site verification; onlyv=spf1records count. - Send a test to a Gmail address you own, open it, choose Show original, and look for
spf=permerrorin the Authentication-Results line. The free email header analyzer reads that line for you.
How to merge them into one record
Keep one v=spf1 at the start, put every sending service's mechanisms in the middle, and end with one all. For example, if you have these two records:
v=spf1 include:_spf.google.com ~allv=spf1 include:sendingtool.example -all
merge them into a single record: v=spf1 include:_spf.google.com include:sendingtool.example ~all. Then delete the extra record. Use the real include values from your providers' setup pages; sendingtool.example is only a placeholder.
Pick the ending on purpose. ~all (softfail) is the common choice while you're still finding every service that sends as you; -all (fail) is stricter. Don't use +all, which lets anyone pass SPF for your domain.
Mistakes to avoid while merging
- Don't leave two
v=spf1strings inside one record. One record means onev=spf1. - Don't put anything after
all; receivers ignore mechanisms that come after it. - Watch the 10-lookup limit. Every
include,a,mx,existsandredirectcounts, including the ones nested inside each include. Merging can push you over, which is also a PermError. See SPF record too many lookups. - Remove services you no longer use instead of carrying them forward.
- A long record split into several quoted strings inside one TXT record is fine; receivers join them. That is not the same as two records.
After you fix it
DNS changes can take a while to show up everywhere, depending on the record's TTL. Re-run the free checker and send a new test to Gmail; you want spf=pass for a domain that matches or shares your From domain. If SPF passes but DMARC still fails, the problem is alignment; see SPF and DKIM pass but DMARC fails.
Duplicate records tend to come back whenever someone connects a new tool and follows its setup guide literally. OutboxWatch's paid plans re-check SPF, DKIM, DMARC, MX and blacklists every day and flag changes; the free checker is there any time you want a quick look.
Frequently asked questions
Can a domain have two SPF records?
No. RFC 7208 says that if a domain has more than one SPF record, the check returns a PermError, which means SPF fails. Combine everything into one record.
What does spf=permerror mean?
The receiver couldn't evaluate your SPF record because of a permanent problem with it, most often two SPF records or more than 10 DNS lookups. It's treated as no SPF pass.
Do I need a separate SPF record for each tool?
No. Each tool's mechanism, usually an include, goes into the same single record for that domain. Subdomains are different: a subdomain like mail.yourdomain.com can have its own one record.
Should my merged record end with ~all or -all?
Either is valid. ~all is the safer choice while you confirm every service that sends as your domain; -all tells receivers to reject anything not listed.
Does fixing SPF alone fix spam placement?
It fixes one failure, but placement also depends on DKIM, DMARC, blacklists, volume and content. Check all of them; see the cold email deliverability checklist.
Related guides
- SPF record: too many DNS lookups, and how to fix it
- SPF and DKIM pass but DMARC fails: how alignment works and how to fix it
- Why are my cold emails going to spam?
- Cold email deliverability checklist
- SPF record longer than 255 characters: how to split it correctly
- SPF void lookup limit: why a dead include makes SPF fail
- All guides
- Monitoring plans