InboxNest

SPF checker

Check a domain’s SPF record for syntax errors, duplicate records, a weak “all” rule, and the 10-lookup limit, counted through every include.

Up to 10, separated by commas, spaces or new lines. You can also paste an email address.

Try an example: tryinboxnest.com gmail.com

Privacy: this tool reads public DNS records only, through Cloudflare’s and Google’s public DNS resolvers. It doesn’t save the domains you check. DNS answers are cached for up to 5 minutes, and checks are counted per IP address (stored as a one-way hash) to prevent abuse. Like every page on this site, the address you load, including the domain in a results link, appears in our web server logs for about two weeks.

What an SPF record does

SPF (Sender Policy Framework, RFC 7208) is a list of the servers allowed to send mail for your domain, published as one TXT record at the root of the domain. When a message arrives, the receiving server takes the domain from the envelope sender (the Return-Path, which people never see), fetches that domain’s SPF record, and checks whether the connecting server’s IP address is on the list.

A record looks like this:

v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 ~all

It reads left to right. include: pulls in another domain’s SPF list (how email services publish their servers), ip4: and ip6: list addresses directly, a and mx authorize the domain’s own web or mail servers, and the final all says what to do about everything else.

How to read the results

The checker finds every TXT record at the domain that begins with v=spf1, then:

  • confirms there’s exactly one;
  • checks each term’s syntax, catching unknown mechanisms, bad IP ranges and the common include= typo;
  • looks at the final all rule;
  • follows every include: and redirect= to count DNS lookups the way a receiver would, showing the tree of nested records. It stops at loops and caps how deep and how many records it follows.

A fail means receivers will return a permanent error (permerror) or SPF gives no protection at all. A warning means SPF works but is fragile or weak. When the problem can be fixed mechanically (a missing or weak all, a ptr term, entries after all, or several records that need merging), you get a corrected record to copy.

The 10-lookup limit

This is where most SPF records break. To stop SPF being used to flood DNS, RFC 7208 (section 4.6.4) caps the number of terms that need a DNS lookup at 10 per check. The terms that count are include, a, mx, ptr, exists and the redirect modifier, and the count includes everything nested inside your includes. ip4, ip6 and all are free. Go over 10 and the receiver stops with a permanent error, so SPF fails for every message, including the legitimate ones.

The trap is that you can’t see nested lookups by reading your own record. One include: for a large provider can cost three or four lookups by itself. The checker counts all of them and shows the tree, so you can see which include is expensive. It also counts “void” lookups: includes that point at a name with no SPF record. RFC 7208 recommends failing after two of those, and an include with no SPF record behind it fails anyway.

The checker counts lookups exactly for include and redirect, which it follows. For mx, it counts the term itself but doesn’t also count the address lookups for each mail server, which RFC 7208 limits separately to 10 per mx term.

SPF checks the Return-Path, not the From address

Receivers check SPF on the domain in the envelope sender, also called the Return-Path, which isn’t always the domain your customers see. Many sending services, including Postmark (which InboxNest uses), give each domain a custom Return-Path: a subdomain such as pm-bounces.yourdomain, set up as a CNAME to pm.mtasv.net. SPF for that mail is checked on pm-bounces.yourdomain, whose record already authorizes Postmark’s servers. Because the subdomain belongs to your domain, it also aligns for DMARC (Postmark: custom Return-Path).

So a domain can send perfectly authenticated mail through Postmark without any SPF record at its root. Postmark says so directly: “The Return-Path domain is now used by receiving email domains to check for SPF alignment” (Postmark: why Postmark isn’t needed in your SPF record). When the checker finds a Postmark Return-Path at pm-bounces, it checks SPF there. It only asks for a root SPF record if your mailboxes are at a provider, such as Google Workspace or Microsoft 365, that sends with the root domain as the envelope sender.

~all, -all, ?all and +all

  • -all (hard fail): unlisted servers fail SPF. Microsoft recommends it for Microsoft 365 domains that also use DKIM and DMARC (Microsoft: set up SPF).
  • ~all (soft fail): unlisted servers are “probably not authorized”. It’s what Google recommends for Workspace (Google: set up SPF). With DMARC in place, either works, because DMARC decides what happens to the failure.
  • ?all (neutral): says nothing, so it protects nothing. The checker warns about it.
  • +all: authorizes every server on the internet. Always a mistake, and a fail.
  • No all and no redirect=: the result defaults to neutral, the same as ?all.

Common mistakes, and how to fix each

  • Two SPF records. It happens when a new service tells you to “add this TXT record” and you add it alongside the old one. RFC 7208 allows one, and with two, receivers return permerror. Merge them: keep one v=spf1, combine the includes and addresses, and end with a single all. The checker builds the merged record for you; check it before publishing.
  • Over 10 lookups. Remove services you’ve stopped using, then move bulk or marketing tools to a subdomain (for example news.yourdomain) with its own SPF record and its own budget of 10. Replacing an include with ip4: ranges (“flattening”) also works, but only for providers that publish stable addresses; you have to maintain it by hand.
  • An include with no SPF behind it. A typo, or a provider that changed its include name. SPF fails with a permanent error. Check the exact value in the provider’s documentation.
  • Using ptr. RFC 7208 says it shouldn’t be used: it’s slow and some receivers skip it. Replace it with the addresses or includes it was standing in for.
  • Entries after all. Evaluation stops at all, so anything after it is ignored. Move them before it.
  • Assuming SPF covers subdomains. It doesn’t. Every hostname that sends mail needs its own record.
  • Syntax slips. include= instead of include:, a space after the colon, or a stray trailing dot. Each one can break the whole record.

Why SPF matters for support email

SPF is one of the two checks every major mailbox provider asks for. Gmail requires SPF or DKIM from all senders and both from those sending more than 5,000 messages a day (Gmail sender guidelines). Yahoo asks for the same (Yahoo best practices). Outlook.com requires SPF to pass for domains sending over 5,000 a day (Microsoft).

For a support team, the risk is usually a quiet one. Someone adds a new helpdesk or billing tool, its replies go out from your domain, and nobody updates SPF, or the update pushes the record past 10 lookups. Everything still looks fine from the sending side. Run the checker after every new tool you connect to your domain.

On its own, SPF only covers the hidden envelope sender. To protect the From address your customers read, pair it with DKIM and DMARC.

Frequently asked questions

What is the SPF 10-lookup limit?

While checking SPF, a receiver may make at most 10 DNS lookups for include, a, mx, ptr and exists terms and the redirect modifier, including everything nested inside your includes. Past 10, SPF returns a permanent error and fails. ip4 and ip6 entries don’t count.

Can I have two SPF records?

No. A domain must publish exactly one TXT record that starts with v=spf1. With two or more, receivers return a permanent error and SPF fails for every message. Merge them into one record.

Should I use ~all or -all?

Both are fine when you also publish DMARC, because DMARC decides what happens to failing mail. ~all (soft fail) is the more forgiving and is what Google recommends for Workspace. -all (hard fail) is what Microsoft recommends for Microsoft 365. Avoid ?all and never use +all.

Does SPF protect the From address people see?

Not on its own. SPF checks the envelope sender (the Return-Path), which people don’t see. DMARC connects SPF to the visible From address by requiring the two domains to align.

Do I need SPF if my email provider signs with DKIM?

Yes. Gmail and Yahoo require SPF or DKIM from every sender and both from bulk senders, and Microsoft requires both for high-volume senders. SPF also covers mail that loses its DKIM signature along the way.

How do I get under 10 lookups?

Remove includes for services you no longer use, replace includes with ip4: and ip6: ranges only where the provider documents stable addresses, and move bulk or marketing senders to a subdomain with its own SPF record.

Why does my domain pass SPF without an SPF record at its root?

Receivers check SPF on the envelope sender (the Return-Path), not the From address. If you send through Postmark with a custom Return-Path such as pm-bounces.yourdomain, SPF is checked on that subdomain, which points to Postmark and already lists its servers. You only need a root SPF record if another service, such as a Google Workspace or Microsoft 365 mailbox, sends with your root domain as the envelope sender.

What is a void lookup?

A lookup that finds nothing, such as an include pointing at a domain that has no SPF record or doesn’t exist. RFC 7208 recommends failing after two of them, and an include with no SPF record fails anyway.

Want support@ working on this domain in a few minutes? Try InboxNest free for 7 days.