Email Security · Jason Osborne

Multiple SPF Records: How to Combine Them Into One

Multiple SPF Records: How to Combine Them Into One

A domain must have exactly one SPF record. If there are two, receivers return a permanent error and neither one counts. This usually happens when a new email service asks you to “add this SPF record” and it gets added beside the old one.

How to tell

Look at the TXT records for your domain. Any record that starts with v=spf1 is an SPF record. Our SPF record checker flags duplicates.

How to merge them

  1. Copy both records somewhere safe before changing anything.
  2. Start the new record with v=spf1, written once.
  3. Add every include:, ip4:, ip6:, a and mx entry from both records, removing repeats.
  4. End with one all entry, such as -all or ~all.
  5. Edit one of the old records to hold the merged value and delete the other.
  6. Check the result, then send a test message from each service.

An example

Before, two records:

v=spf1 include:spf.protection.outlook.com -all

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

After, one record:

v=spf1 include:spf.protection.outlook.com include:_spf.google.com ~all

Use your own services, not these. Leave out any you no longer use.

When not to combine by hand

This simple method works when each record holds only include:, ip4:, ip6:, a or mx entries and ends in ~all or -all. If any record has redirect=, a % macro, ?all, +all or anything after all, combining them can change who is allowed to send. Ask your email provider or IT person.

Watch the lookup limit

Merging adds the lookups together. If the total goes over 10, see how to fix too many DNS lookups.