Email Spam Tester

Email Spam Tester › Fixes › Multiple SPF records

Multiple SPF records

By Serhii TanichevUpdated

A domain may publish one SPF record, in total rather than one per provider. When a receiver finds two TXT records on the same name that both start with v=spf1, it stops and returns permerror (RFC 7208, section 4.5), and DMARC counts that as SPF not passing. Neither record is used, including the one that was correct.

How the second record gets there

In most cases each provider's setup guide says "add this TXT record", and each guide shows a complete record of its own: Google Workspace asks for v=spf1 include:_spf.google.com ~all, the newsletter platform for v=spf1 include:servers.mcsv.net ~all, the helpdesk for a third. Following all of them literally gives the domain three records.

Hosting panels add one too. Plesk puts SPF in its default DNS template and cPanel can create one for each new domain, so a record added later for an outside provider may end up next to it.

Other TXT records on the same name are not the problem. Verification strings for Google, Microsoft or Facebook can sit next to SPF. Only the ones starting with v=spf1 count.

Combining them

Take every record, keep one v=spf1 at the start, collect the mechanisms from all of them, and end with a single all:

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

Order matters a little, since the receiver stops at the first mechanism that matches, so the service that sends most of your mail can go first. Mechanisms that appear in two of the old records go in once. Where the old records disagreed on the ending, ~all is the safe choice while DMARC reports still show you who sends as the domain; -all once they do not.

Then delete the old records. A panel that keeps them as separate entries still publishes them.

After the merge

Merging adds the DNS lookups of every record into one. Each include, a, mx, exists and redirect costs one, counted across the whole include tree, and the limit is ten. Three providers with a few nested includes each can pass that, and the result is a different permerror for the same domain. The SPF checker counts the lookups of the merged record; if it is over ten, the page on too many DNS lookups covers what to cut.

Subdomains are separate names

news.example.com is a different DNS name from example.com, and it may have its own SPF record. That is not a second record for the domain, and it is often the cleaner setup: put the newsletter on a subdomain with its own SPF, and the main domain's record stays short.

How the test reports it

A test message from a domain with two SPF records comes back with permerror in the SPF result, the record the receiving server read and that server's comment. The SPF checker goes further and lists every record on the name side by side, which is the quickest way to see what to merge.

Try it on your own email

Send one message to a disposable address and read every check in the report, RFC section and all. Free, no signup.

Run a test

Other findings