SPF fail: what it means and how to fix it

SPF is a list, published in your DNS, of the servers allowed to send mail for your domain. When a message arrives, the receiving server compares the address it came from with that list. "Fail" or "softfail" means the server wasn't on it. "Permerror" means the list itself is broken, so the receiver can't use it at all.

The fix depends on which of those you got and for which domain, so start by finding out. Run the check below on your domain to see whether its SPF record is valid and how many DNS lookups it needs.

DNS Mail Check is a service for owners of business and organization domains. The checks on this page are free for any domain.

The part after the @ in your email address. Enter a domain or address to check.

Diagnose an SPF failure in three steps

Find the envelope sender domain SPF actually checked, test that domain's record, then work out whose server the sending IP belongs to.

Read moreShow less: Diagnose an SPF failure in three steps
  1. Find the domain SPF actually checked. SPF doesn't look at the From address people see. It checks the envelope sender, the hidden bounce address shown as smtp.mailfrom in the headers. Paste a failing message's headers into the header analyzer to see that domain, the result, and the IP address that sent it.
  2. Check that domain's record. The SPF checker says whether the record is valid, counts its DNS lookups through every include, and shows the include tree. Any error it reports will cause a permerror at receivers whenever their evaluation reaches it.
  3. Identify the sending IP. If the record is valid, the sending server simply isn't in it. The reverse DNS lookup on the IP from the headers usually reveals whose server it is, such as a newsletter service, your web host or a forwarding provider, which tells you what to add.

SPF result words, in plain English

What each SPF result means, from pass and fail through to permerror and temperror.

Read moreShow less: SPF result words, in plain English
  • pass: the server is on the list.
  • fail: it isn't, and the record ends in -all, which says "reject anything not listed".
  • softfail: it isn't, and the record ends in ~all, "probably not us, but don't reject on this alone".
  • neutral: the record ends in ?all, which makes no claim either way. Receivers must treat it the same as having no SPF record.
  • none: no SPF record was found.
  • permerror: the record can't be evaluated because it's broken.
  • temperror: a temporary error, usually a DNS lookup that timed out or failed; a retry may succeed.

Causes of SPF failure, most common first

Six causes, from a sending service missing from your record to too many void lookups.

Read moreShow less: Causes of SPF failure, most common first

1. A service that sends for you isn't in the record

You started using a new newsletter tool, CRM, booking system or helpdesk, and it sends as your domain from its own servers. Until its include is in your record, its mail fails or softfails.

  • Confirm it: the IP address in the failing message belongs to the service.
  • Fix it: add the include value from the service's setup guide to your existing record, keeping one v=spf1 line. Many services instead use their own bounce domain, in which case SPF isn't the check that matters and you set up DKIM with them.

2. Too many DNS lookups

Every include, a, mx, ptr and exists in the record, and in every record it includes, costs one DNS lookup, as does a redirect. The standard allows 10. Receivers read the record from left to right and stop at the first match, so mail from servers listed early still passes. Mail that's only matched after the tenth lookup, or not matched at all, gets a permerror.

  • Confirm it: the SPF checker reports the total, such as "Too many DNS lookups: 17 (limit 10)", and the include tree shows which branch costs most.
  • Fix it: remove includes for services you've stopped using, replace an a or mx term with the ip4: address it stands for if that address rarely changes, or move one sending service to a subdomain with its own SPF record.

3. Two SPF records

A domain may have only one TXT record starting with v=spf1. With two, every message gets a permerror. This usually happens when a second service's setup guide says "add this TXT record" and someone adds it rather than merging it.

  • Confirm it: the SPF checker shows both records.
  • Fix it: merge them into one record with all the includes, and a single all at the end.

4. Forwarded mail

When someone forwards your message, or a mailing list resends it, the next server sees the forwarder's IP address, which isn't in your record. SPF fails at that point, and there's nothing you can add to fix it, because you can't list every forwarder.

  • Confirm it: the failing IP belongs to a university, list host or forwarding service, and the same message passed SPF at its first stop.
  • Fix it: make sure your mail is signed with DKIM for your domain, which usually survives forwarding, so DMARC can still pass.

5. A broken include or a typing mistake

An include pointing at a domain that has no SPF record is a permerror on its own, which often happens after a service changes or retires its include name. Other mistakes: a record that doesn't begin exactly v=spf1 (receivers then ignore it, as if you had no SPF record), include: with nothing after it, a stray comma or quote, or an ip4: range written wrongly.

  • Confirm it: the SPF checker marks the bad term in the include tree or says "SPF record has errors".
  • Fix it: correct or remove the term, using the current value from the service's documentation.

6. Too many void lookups

A name in an a, mx, exists or include term that returns no records at all is a "void" lookup. Receivers that follow the standard's recommended limit return a permerror after more than two. They're usually left over from servers or services that no longer exist; remove those terms.

Provider fixes

The SPF value Google Workspace and Microsoft 365 each give for a domain that sends only through them, and the custom MAIL FROM setup that lets Amazon SES align with your domain.

Read moreShow less: Provider fixes

Google Workspace

Google's recommended record for a domain that only sends through Gmail is v=spf1 include:_spf.google.com ~all. Google recommends ~all. If other services send for you, add their includes to the same line before the ~all.

Microsoft 365

Microsoft's value for a domain that only sends through Microsoft 365 is v=spf1 include:spf.protection.outlook.com -all, and it recommends -all. Microsoft asks you not to replace its include with a copied list of its IP addresses, because the ranges change. If you also send from on-premises servers, add their ip4: addresses to the same record.

Amazon SES

By default Amazon SES sends with a bounce address under amazonses.com, so SPF passes for Amazon, not for you. To make SPF align with your domain, set up a custom MAIL FROM domain in the SES console, a subdomain such as bounce.yourdomain.com, and publish the two records SES asks for there: an MX record pointing at the feedback server for your SES region, and a TXT record v=spf1 include:amazonses.com ~all.

Worked example: who.int, checked 21 October 2026

A real record with two top-level includes that costs 17 lookups, which senders still pass, and how moving two senders to subdomains could bring it down to 8.

Read moreShow less: Worked example: who.int, checked 21 October 2026

We ran the SPF checker on who.int, the World Health Organization's domain. Its record is:

v=spf1 ip4:158.232.12.0/24 include:spf.protection.outlook.com include:_spfincludes.who.int -all

The result line was "Too many DNS lookups: 17 (limit 10)", with the summary "SPF is published but has an error, so receivers can't use it for some or all of this domain's mail."

The top-level record looks small, with only two includes. The cost is inside _spfincludes.who.int, which adds ServiceNow (1 lookup), the UN computing centre's servers through a chain of three includes (3), Salesforce (2), Oracle's recruitment and email delivery service (5) and Zoho (4). Adding the two top-level includes gives 17.

Because receivers stop at the first match, who.int's own network and Microsoft 365 still pass: they're listed before any lookup-heavy include. The 11th lookup falls inside Oracle's include, so mail from Oracle servers listed after that point and all mail from Zoho gets a permerror. So does every forged message, which with -all should have got a plain fail. who.int publishes a DMARC policy of p=reject, so its mail from those services passes DMARC only if it carries a valid DKIM signature aligned with who.int (d=who.int or one of its subdomains).

The exact fix is to bring the total to 10 or fewer. Moving the two most expensive senders, Oracle's (5) and Zoho (4), to subdomains with their own SPF records, if those services allow a subdomain bounce address, would bring the main record down to 8 lookups.

When to get help

Plan before editing a record near the lookup limit, send whoever manages your DNS the include tree, and get help when only one receiver fails your SPF.

Read moreShow less: When to get help

If your record needs many services and you're near the limit, plan the change before editing: removing the wrong include stops that service's mail from passing SPF. If your DNS is managed by an agency or IT provider, send them the SPF checker's include tree; it shows exactly which branch to change.

Get help as well if mail fails SPF only at one receiver while passing everywhere else. That points at a local rule or forwarding setup on their side, which only their administrators can see.

SPF failure questions

Answers on softfail, -all versus ~all, which address SPF checks, and listing IP addresses to save lookups.

Is softfail a failure?

Technically it's a weak "probably not authorised". The standard says receivers shouldn't reject mail on a softfail alone, but they may treat it with more suspicion. For DMARC, a softfail is simply not a pass, so it counts the same as a fail.

Should my record end with -all or ~all?

Either works once DMARC is enforcing and your mail is DKIM-signed, because DMARC then decides what happens to failing mail. Google recommends ~all; Microsoft recommends -all. Some receivers reject on -all before DMARC is even consulted, which can cost you forwarded mail, so ~all is the gentler choice if you're unsure.

Does SPF check the From address in my email?

No. It checks the envelope sender, the bounce address the sending server announces before the message itself is sent. That's often a different domain from the one people see. DMARC is what connects SPF to the visible From address.

Can I avoid the lookup limit by listing IP addresses instead of includes?

For your own servers, yes: ip4: and ip6: terms cost no lookups. For a provider's include it's risky, because the provider can change its addresses without telling you and your copy goes out of date. Microsoft explicitly asks customers not to do this with its include.

Related problems and tools

Guide: SPF's 10-lookup limit.