SPF guide

Multiple SPF records: how to merge them into one

Two SPF records make SPF fail for all your email. Here is how to merge them into one record that works.

Why two SPF records break everything

The SPF standard allows one SPF record per domain. When an inbox finds two TXT records starting with v=spf1, it doesn’t pick one: it returns a permanent error and SPF fails for every email you send, including from services that are listed.

It usually happens because each new service says “add this TXT record”, and someone adds a second record instead of editing the first.

How to merge them

1

Find all of them. The SPF checker lists every SPF record on your domain and writes the merged version for you.

2

Keep one v=spf1 at the start.

3

Copy every include, ip4, ip6, a and mx from all the records into the one record. Drop duplicates.

4

Keep a single ending at the end: ~all is the safe choice.

5

Save the merged record and delete the others. Other TXT records, such as Google site verification, are fine to keep: only records starting with v=spf1 count.

Before and after

Two records, so SPF fails:

v=spf1 include:_spf.google.com ~all

v=spf1 include:servers.mcsv.net -all

One merged record:

v=spf1 include:_spf.google.com include:servers.mcsv.net ~all

Watch the lookup limit

Merging adds the includes together, and SPF allows at most 10 DNS lookups. Check the merged record before you publish it with the SPF record generator, which counts every lookup.

Check it worked

Run the checker again after you save. It should find exactly one record.