Skip to content
dnscheck.app

Guides

Fix SPF PermError: Find the Cause and Correct the Record

Updated 22 November 2026

What an SPF PermError means and which cause matches your message

A permerror means the domain's published SPF records could not be correctly interpreted, so the check fails permanently until the DNS operator changes something. An SPF record lists the servers that are authorized to send email for your domain (what an SPF record is).

A permerror is likely caused by a record that exceeds the 10 DNS lookup limit, or by multiple SPF records at the same name. Other causes include syntax errors and broken includes. Receiving servers may treat the result as a permanent error and reject or flag the mail. Behavior varies by receiver. Microsoft's documentation describes it this way: when evaluation needs more than 10 DNS lookups, the message fails SPF with a permerror and the destination system rejects it with an NDR (non-delivery report). Other receivers may behave differently.

A temperror is a different result. It comes from a temporary DNS failure while querying the record, such as an unreachable or timed-out authoritative nameserver (the server that holds the zone's records). The record itself may be fine, so do not rewrite it. Check again later.

What you see Likely cause Go to section
Two or more v=spf1 TXT records on one name Multiple SPF records Fix multiple SPF records
"Too many DNS lookups", more than 10 DNS-querying terms Lookup limit exceeded Fix too many DNS lookups
Record rejected as invalid, no v=spf1 at the start Syntax error Fix syntax errors
An include: or redirect= target returns nothing or has no SPF record Broken include or redirect Fix syntax errors, broken includes
More than 2 void lookups Names in the record that return no answer Fix syntax errors, broken includes
Temperror, DNS timeout Temporary DNS failure, not a record fault Do not rewrite the record; retry

Confirm the cause on your own domain

Diagnose first. Before you change anything, copy the current record into a safe place. If a fix goes wrong, you can restore it.

Check the record with the SPF checker

Check your SPF record with the SPF checker. Free online tools can show the SPF TXT record, and some also calculate the number of DNS lookups it needs. Compare what the checker reports with the table above. A result that names two records, a lookup count above 10, or a syntax problem points you to one section below.

View the raw TXT records

View the raw TXT records on your domain. An SPF record is a single text string in a single DNS TXT record. It is published at the name it covers, not in a subdomain under it. SPF records MUST be published as TXT (type 16) records. The dedicated SPF record type is discontinued.

Other TXT records at the same name, such as site-verification strings, are not SPF records. Care must be taken that only SPF records are used for SPF processing. Count only the records that start with v=spf1.

If the answer holds no SPF record at all, that is a different problem. Receiving servers cannot verify that the domain authorizes the sending server, and messages may be rejected or marked as spam.

Read the record with dig

dig TXT example.com +short

A sample answer, not real tool output, with two SPF records among other TXT strings:

"example-verification=abc123"
"v=spf1 include:spf.protection.outlook.com -all"
"v=spf1 include:spf.mailer.example.net -all"

You can also filter for the SPF strings.

dig TXT example.com +short | grep spf

On Windows:

Resolve-DnsName -Name example.com -Type TXT

Two v=spf1 lines, as in the sample, mean multiple records. To count lookups, use the checker or follow the counting steps below.

Fix multiple SPF records by merging them into one

This is the most common cause. A domain name MUST NOT have multiple records that would cause an authorization check to select more than one record. An SPF record is one TXT record, and multiple SPF records are not permitted for the same owner name. Adding a second record for a new service is therefore not a valid way to authorize it. Combine services in one record using separate include: statements.

Wrong: two SPF records at the same name.

example.com.  3600  IN  TXT  "v=spf1 include:spf.protection.outlook.com -all"
example.com.  3600  IN  TXT  "v=spf1 include:spf.mailer.example.net -all"

Corrected: one record with both includes and a single all at the end.

example.com.  3600  IN  TXT  "v=spf1 include:spf.protection.outlook.com include:spf.mailer.example.net -all"

Merge the records step by step

  1. Note every v=spf1 record on the name exactly as published.
  2. List every sender each record authorizes.
  3. Write one record that holds all those mechanisms, with one all at the end. Use ~all or -all, not +all.
  4. Publish the new record next to the old ones. Do not delete the old records yet.
  5. Confirm the new record contains every legitimate sender. Then remove the old records, so exactly one v=spf1 record remains.

To authorize one more sender, add its IP or include to the single record. For example, v=spf1 ip4:192.0.2.10 include:spf.protection.outlook.com ~all.

If a provider added a second record

Cloudflare's documentation says that if an SPF record already exists on the root domain, you should modify it to include include:_spf.mx.cloudflare.net rather than add a second record.

As a last resort, Cloudflare also documents deleting every v=spf1 TXT record on the affected name and re-onboarding or re-enabling the service so Cloudflare regenerates the correct record. That removes every SPF record on the name, including the ones for your other senders. Use it only with your noted copy at hand, and re-add the other senders afterwards.

Fix too many DNS lookups: count them, then trim

SPF implementations MUST limit the total number of DNS-querying terms to 10 during evaluation, and MUST return permerror if the limit is exceeded.

Which mechanisms count toward the limit

Mechanism or modifier Counts toward the 10?
include Yes
a Yes
mx Yes
ptr Yes
exists Yes
redirect Yes
ip4, ip6 No
all No
exp No

Two extra limits apply on top of the overall one. For mx, the MX records queried count toward the 10. Each MX record's evaluation MUST NOT query more than 10 address records, and exceeding that yields permerror. For ptr, the PTR records queried count toward the 10. Address-record lookups beyond the first 10 per PTR record are ignored and do not cause an error.

How to count nested includes

Each include: needs at least one lookup, and more if the target record has includes of its own. An include that points to a record with three more includes adds four lookups. So fewer than 10 include: statements does not guarantee fewer than 10 lookups. To count, open each included domain's TXT record and apply the table to it. The SPF checker may do this for you.

Worked count for this record:

example.com.  3600  IN  TXT  "v=spf1 ip4:192.0.2.10 include:spf.mailer.example.net include:spf.crm.example.net -all"
ip4:192.0.2.10                  0   (no DNS query)
include:spf.mailer.example.net  1 + 3 nested includes = 4
include:spf.crm.example.net     1
-all                            0
Total                           5

Reduce the count without dropping a sender

Remove unnecessary entries first. The most common one is an include for a vendor you no longer use. Confirm that the vendor sends nothing for your domain, then remove it.

Before, over the limit:

example.com.  3600  IN  TXT  "v=spf1 include:spf.mailer.example.net include:spf.crm.example.net include:spf.oldvendor.example.org -all"

After, with the unused vendor removed:

example.com.  3600  IN  TXT  "v=spf1 include:spf.mailer.example.net include:spf.crm.example.net -all"

Publishers should keep the DNS cost of a record low, and can place cheaper mechanisms earlier. One source recommends using ip4/ip6 mechanisms, or flattening, to reduce lookups. For a server you control, you can replace a lookup with its address.

Before:

example.com.  3600  IN  TXT  "v=spf1 a:mail.example.com include:spf.mailer.example.net -all"

After:

example.com.  3600  IN  TXT  "v=spf1 ip4:198.51.100.25 include:spf.mailer.example.net -all"

The ip4 term costs no lookup. If that server's address changes, you must update the record yourself. This is good practice, not a rule from the standard.

What flattening does and what the evidence does not settle

Flattening replaces include: mechanisms with the IP addresses they resolve to, to reduce DNS lookups. The sources here give no general verdict on whether it is safe. One caution is documented for Microsoft 365: do not flatten include:spf.protection.outlook.com, because Microsoft's sending infrastructure uses dynamic IP addresses that change frequently. Treat flattening as a last option. It needs a plan for keeping the addresses current.

Fix syntax errors, broken includes and redirects, and void lookups

Syntax errors

If there is a syntax error anywhere in an SPF record, the check returns permerror immediately, without further evaluation. SPF records must start with v=spf1, and a missing version is a common syntax error.

Wrong: no v= prefix.

example.com.  3600  IN  TXT  "spf1 include:spf.protection.outlook.com -all"

Corrected:

example.com.  3600  IN  TXT  "v=spf1 include:spf.protection.outlook.com -all"

Check the end of the record too. The all mechanism should be ~all (SoftFail) or -all (Fail), not +all. ?all (neutral) is for testing and is not recommended in production. Mechanisms listed after all MUST be ignored, and any redirect modifier MUST be ignored when an all mechanism is present. Move anything you still need before all.

Very long records could be silently ignored by some verifiers if they do not fit in a single UDP packet. If your record is long, shorten it.

An include or redirect that points nowhere

An include whose evaluation returns permerror or none makes the include itself return permerror. A referenced record that exceeds limits or is missing therefore passes the error up. To verify an include: entry, query the TXT record of the referenced domain.

dig TXT spf.mailer.example.net +short

An empty answer means no SPF record is published at that name. An include: domain that does not resolve or has no SPF record causes permerror, and messages might be rejected. Correct the spelling of the name, or remove the include if the vendor is gone. Check a redirect= target the same way.

More than 2 void lookups

A void lookup is a lookup that returns an empty answer or NXDOMAIN (the name does not exist). SPF implementations SHOULD limit void lookups to two. The limit may be configurable, and exceeding it produces permerror. This is a separate limit from the 10-term limit. A record can be under 10 terms and still hit it.

Find the mechanism or include whose name returns no answer. Query each name in the record with dig, then correct or remove that mechanism.

Verify the fix and allow for DNS caching

  1. Re-run the SPF checker. It should report no permerror, a single v=spf1 record and a lookup count of 10 or fewer.
  2. Query the record again.
dig TXT example.com +short | grep spf

The expected answer is exactly one quoted line:

"v=spf1 include:spf.protection.outlook.com include:spf.mailer.example.net -all"

The Microsoft Remote Connectivity Analyzer can also validate an SPF record.

Resolvers (the servers that look up DNS answers for mail receivers) may keep the old answer until its TTL expires. See which resolvers still return the old record to view the current state. No propagation time is guaranteed.

Once the change is stable, one source suggests a TTL of at least 3600 seconds (one hour) on the SPF record to avoid DNS lookup timeouts. That is a suggestion from one source, not part of the standard. If you plan more edits, lower the TTL first as usual.

Then send a test message from each service that sends for your domain. Check the SPF result in the received headers. This is good practice, not a cited rule. If mail fails shortly after DNS edits, contact your mail provider with the specific error or bounce message. They can tell whether the problem is DNS resolution, server configuration or message delivery.

Why SPF and DKIM pass but DMARC fails

A clean SPF record does not guarantee DMARC passes. DMARC requires that either SPF or DKIM passes and that the authenticated domain aligns with the From address domain. SPF and DKIM can both pass while DMARC fails, if neither passing domain aligns. SPF pass plus DKIM pass with DMARC fail indicates an alignment problem. The dmarc result needs SPF or DKIM to pass with alignment.

The reason is that SPF authorizes the "MAIL FROM" and "HELO" identities. It gives no assurance about other identities such as the From header. Two common scenarios:

  • A marketing service passes SPF and DKIM for its own domain. Neither aligns with your From domain, so DMARC has no aligned pass.
  • A gateway modifies the message body and breaks DKIM. Its SPF pass does not align with the From domain, so DMARC fails even though SPF passes.

DMARC treats both -all and ~all as SPF failures. The DMARC policy is effectively ignored for ~all failures when the message has no DKIM signature, so one source recommends -all so DMARC can act on those messages.

SPF alone is not enough. For the best protection you also need DKIM and DMARC. Authentication is necessary but not sufficient for delivery, and it does not promise inbox placement. Check your DMARC policy and alignment. DMARC reporting also helps identify mail sources and SPF failures for the domain.

References

Check it yourself

  • SPF

    Syntax, the include tree, and the 10-lookup limit.

  • TXT lookup

    TXT records, including SPF and site verification strings.

  • DMARC

    Policy, alignment, report addresses and syntax.

  • Propagation

    What more than 30 public resolvers return, next to the authoritative answer.