New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
Free tool

SPF record checker

Enter a domain to see its SPF record, count the DNS lookups and find the mistakes that make SPF fail.

  • No sign-up
  • Live DNS lookup
  • Follows every include

Enter a domain or an email address.

This checks the record as it is published in DNS right now. It does not test whether one particular message passed SPF. To see that, open the message headers and read the Authentication-Results line. Recent changes can take time to appear because of DNS caching.

What an SPF record does

SPF (Sender Policy Framework) lets a domain publish, in DNS, the list of servers that are allowed to send email for it. When a message arrives, the receiving server looks at the domain in the envelope sender (the Return-Path, also called MAIL FROM) and reads that domain's SPF record. If the connecting IP address is on the list, SPF passes. If not, the record says what the receiver should do about it.

SPF does not look at the From address your recipients see. That is why a message can pass SPF and still fail DMARC: the two domains have to line up, and SPF alone does not make them.

How to read the record

An SPF record is a single line of text that starts with v=spf1 and is made of terms read from left to right. The first term that matches the sending IP decides the result.

TermWhat it means
ip4:203.0.113.0/24, ip6:...Allows a fixed address or range. Costs no DNS lookup.
include:example.netAlso allows whatever example.net's own SPF record allows. Costs one lookup, plus any lookups inside it.
a, mxAllows the addresses of the domain's A or MX records. Each costs lookups.
redirect=example.netReplaces this record with the one at example.net. Used when another domain should decide everything.
exists:, ptrRarely needed. ptr is deprecated by the standard and should not be used.
-all, ~all, ?all, +allThe catch-all at the end: reject, soft fail, neutral, or allow everything. +all lets anyone send as you.

The 10 DNS lookup limit

The SPF standard (RFC 7208) lets a receiver spend at most ten DNS lookups evaluating a record. The terms include, a, mx, ptr, exists and redirect each count, and so does every lookup inside an included record. Go past ten and the result is a permanent error, which receivers treat as a failure.

Stacking several email services is the usual cause: a marketing platform, a helpdesk, a CRM and a mail provider can use most of the budget between them. The checker follows every include the way a receiver does and shows the count against the limit, so you can see which branch is expensive.

The standard also limits "void" lookups (names that return nothing) to two. An include that points at a domain with no SPF record is counted as a problem for that reason.

Fixes that work: remove services you no longer use, replace a, mx and include terms with ip4 and ip6 ranges where the provider publishes stable ones, and send different kinds of mail from different subdomains so each has its own record.

Mistakes the checker flags

These are the problems we see most often, and the checker reports each one with a plain-language fix.

  • More than one SPF record on the same domain. Receivers treat this as an error, so merge the records into one.
  • A record that ends in +all, or ?all on a domain that sends real mail. +all authorises every server on the internet.
  • No all term at all, which leaves the result for unlisted servers undefined.
  • A typo in a mechanism name or an IP address, which makes the whole record invalid.
  • An include pointing at a domain that has no SPF record, or a loop where two records include each other.
  • The ptr mechanism, which is slow, unreliable and deprecated.
  • A record longer than 255 characters that was pasted as one string, or one that no longer fits in a single DNS response.

What passing SPF does not tell you

A clean record means the policy is well formed. It does not prove a particular message passed. To test a real message, open its headers and read the Authentication-Results line, or paste them into our email header analyzer.

SPF also breaks when mail is forwarded, because the forwarding server's IP is not in your record. That is one reason DMARC accepts either SPF or DKIM, and why you should sign your mail with DKIM as well.

Soft fail or hard fail?

Both ~all (soft fail) and -all (hard fail) tell the receiver the sender was not authorised. In practice most receivers use SPF as one signal among several and apply their own judgement, and DMARC is what decides what happens to failing mail. Many organisations publish ~all while they are still discovering all their senders and move to -all when the list is complete. Either is acceptable; +all and a missing all are not.

What the checker looks at

  1. 1

    Finds your record

    Reads the TXT records at the root of the domain and picks out the one that starts with v=spf1. Flags a missing record and a domain with more than one.

  2. 2

    Counts DNS lookups

    Follows every include and redirect the way a receiving server does, and adds up the lookups against the limit of ten.

  3. 3

    Checks the syntax

    Looks for unknown mechanisms, invalid IP addresses and ranges, includes that point nowhere, loops, and terms that are never evaluated.

  4. 4

    Flags risky choices

    Warns about +all and ?all, the deprecated ptr mechanism, a missing all, and records long enough to be a problem for DNS.

Frequently asked questions

What is an SPF record?

An SPF record is a DNS TXT record on your domain that lists the servers allowed to send email for it. Receiving servers compare the sending IP address against that list when a message arrives.

What is the SPF 10 DNS lookup limit?

SPF evaluation may cause at most ten DNS lookups. Every include, a, mx, ptr, exists and redirect counts, and so do the lookups inside the records you include. If a record needs more than ten, receivers return a permanent error and SPF fails for every message from the domain.

Why does the checker count more lookups than I have includes?

Each include points to another record, and that record can contain includes of its own. The checker follows them all and adds them up, which is how a receiver counts. A record with four includes can easily use eight or more lookups.

What does SPF permerror mean?

It means the record could not be evaluated. The usual causes are two SPF records on one domain, more than ten lookups, a syntax mistake, or an include that points to a domain with no SPF record.

Does a passing SPF check mean my email will reach the inbox?

No. SPF is one signal. Receivers also look at DKIM, DMARC alignment, sender reputation, complaint rates and content. Passing SPF is necessary for good deliverability, not sufficient.

Do you keep the domains I check?

The lookups run on our servers, and results are held for about five minutes so repeat checks do not repeat the DNS queries. Checks are not tied to an account, and the tool is rate limited to protect the DNS servers it queries.

Need to build or fix a record?

Follow the step-by-step guide, or use the generator to build a record that stays inside the lookup limit.

Open the SPF guide

Start sending in minutes.

Create an account, add your domain and send your first email.

Start free Talk to sales