Skip to content

SPF Record Checker

Check a domain's SPF record the way receiving mail servers read it, with every DNS lookup counted and every error explained.

Free, no sign-up.

Checking many domains? Run the same check from the API.

An SPF record is a TXT record in your domain’s DNS that lists the servers allowed to send mail for your domain. Receiving mail servers look it up when your mail arrives and check whether the server that delivered it is on that list. The checker above reads your record the same way, counts its DNS lookups and explains every error it finds.

Last updated:

Reading your result #

The result opens with a badge. Fail means the checker found at least one critical problem, Warning means at least one warning and nothing critical, and Pass means the check finished with neither. Notes never change the badge.

Under the badge come a count, such as “0 critical, 1 warning, 2 notes for example.com”, and your record as published. A domain with no record shows “No SPF record found for example.com.” in its place.

The checker counts the six terms that cost a DNS lookup and follows every include and redirect. It shows “Lookups used: 7 of 10” at or under the limit and “Lookups needed: 13. The limit is 10.” over it, since it keeps counting past 10, up to 30.

Void lookups show the same way, as in “Void lookups: 1 of 2”. A count that starts with “at least”, as in “Lookups used: at least 7 of 10”, is a lower bound: the checker couldn’t follow every term to the end, for example because a DNS lookup failed, a record includes itself or an include uses macros.

Below the counts, the lookup tree lists each term that costs a lookup, with the lookups it uses, counting everything under it. An include or redirect whose record has counted terms of its own opens to list them. A problem shows on its term’s line, such as “No SPF record” or “Includes itself”.

The findings come last, grouped as Critical, Warnings and Notes, or “No problems found in this record.” when there are none. Each one says what’s wrong and how to fix it, and most name the RFC section behind it. Errors with a page of their own add a “Read more” link to it, such as too many DNS lookups.

If a DNS lookup fails or times out, the check can’t finish, and the result says “We couldn’t finish this check. Try again in a minute.” When the answers that did arrive hold no critical problem or warning, the badge reads Incomplete, never Pass, and only your record follows the message, if it was read.

The checker keeps a finished result for up to 5 minutes and an unfinished one for up to 60 seconds. Checking the same domain again within that time shows the same result, even if you’ve just changed the record.

How SPF works #

SPF, short for Sender Policy Framework, doesn’t check the From address people see. It checks the domain of the return address in the SMTP MAIL FROM command, where bounces go, and receivers can also check the name the sending server gives in its HELO greeting (RFC 7208 §2.2, RFC 5321 §4.4).

RFC 7208 calls the check check_host() and gives it the connecting server’s IP address, the return address and that address’s domain (§4.1). It looks up the domain’s TXT records, keeps the one that starts with v=spf1 and reads its terms from left to right.

The first term that matches the server ends the check, and that term’s qualifier is the result (§4.6.2). If nothing matches, a redirect decides, and without one the result is neutral (§4.7).

There are seven results, and what a receiver does with each is its own local policy (§2.6, §4.2):

The seven SPF results
Result What it means
pass The server is authorized.
fail The domain says the server isn’t authorized. Receivers may reject the message (§8.4).
softfail Probably not authorized. Receivers shouldn’t reject on this result alone (§8.5).
neutral No statement about this server, which receivers must treat exactly like none (§8.2).
none The domain has no SPF record, or the return address had no usable domain.
temperror A transient error, generally in DNS. A later retry may succeed (§2.6.6).
permerror The published records couldn’t be interpreted, and someone has to fix the DNS (§2.6.7).

SPF record syntax #

Every record starts with exactly v=spf1, then a space or the end of the record (RFC 7208 §4.5), and its terms are separated by spaces. Most are mechanisms, which either match the connecting server or don’t, and a qualifier in front sets the result on a match: + pass (the default), - fail, ~ softfail and ? neutral.

The other terms are modifiers, written name=value. RFC 7208 defines redirect and exp, and each may appear only once, or the check ends in permerror (§6).

SPF terms and their lookup cost
Term Counts toward 10 What it matches or does
all No Every server. It goes last, and mechanisms after it are ignored (§5.1).
include Yes Servers that pass another domain’s SPF record (§5.2).
a Yes The addresses of a host, or of your domain if none is named (§5.3).
mx Yes The addresses of a domain’s MX hosts (§5.4).
ip4 No An IPv4 address or range, as in ip4:192.0.2.0/24 (§5.6).
ip6 No An IPv6 address or range, as in ip6:2001:db8::/32.
exists Yes Any server, if the name it gives has an IPv4 address; macros can build that name from the message (§5.7).
ptr Yes Servers whose reverse DNS name is under a domain (§5.5). Avoid it.
redirect Yes A modifier: use another domain’s record when nothing matched. Ignored if the record has all (§6.1).
exp No A modifier naming a TXT record that explains a fail (§6.2).

Macros are placeholders a receiver fills in for each message, such as %{i} for the connecting server’s IP address (RFC 7208 §7), as in exists:%{i}._spf.example.com. This checker counts such a term as one lookup but can’t follow it, since the name depends on a real message.

A single quoted string in a TXT record holds at most 255 characters, so a longer record is published as several quoted strings in one TXT record, joined without spaces (§3.3). RFC 7208 §3.4 also asks for answers that fit in 512 octets and suggests keeping the name plus the text of all its TXT records under 450 octets, since bigger answers can fall back to TCP or be ignored. The checker notes any SPF record over 450 characters.

The 10 DNS lookup limit #

RFC 7208 §4.6.4 names six terms that cost a DNS lookup, include, a, mx, ptr, exists and the redirect modifier, and caps them:

SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation, to avoid unreasonable load on the DNS. If this limit is exceeded, the implementation MUST return “permerror”.

The other terms cost nothing, and exp is only looked up after the check (RFC 7208 §4.6.4).

The limit covers the whole check: §4.1 calls it a single global limit across every evaluation that includes and redirects start. So an include costs one lookup plus every counted term in the record it points to, and that record belongs to the service, which can add to it without you changing anything.

A void lookup comes back empty: the name doesn’t exist, or it holds no records of the type asked for, as with a term that still names a deleted host. Receivers should allow at most 2 per check, and the next one gives permerror.

Each MX host behind an mx term needs its own address lookup, so an mx term whose domain has more than 10 MX hosts gets permerror, which §5.4 calls the MX lookup limit. For ptr, names past the first 10 are ignored.

SPF record examples #

The services here are made up; your real include values come from each service’s setup guide.

One mail service, 3 lookups. The service’s record holds two more includes:

one-service.zone
example.com.            TXT  "v=spf1 include:_spf.mailhost.example ~all"
_spf.mailhost.example.  TXT  "v=spf1 include:_ip1.mailhost.example include:_ip2.mailhost.example ~all"

Your include costs 1 and the service’s two cost 2, assuming _ip1 and _ip2 hold only ip4 and ip6 terms.

Two services plus your own servers, 4 lookups. Two office servers deliver mail directly, alongside the service above and a CRM whose record holds only ip4 terms:

two-services.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.10 ip4:192.0.2.11 include:_spf.mailhost.example include:spf.crm.example ~all"

The ip4 terms cost nothing, the mail service 3 and the CRM 1.

A subdomain for a newsletter service, 1 lookup. The newsletter uses an address at news.example.com as its return address, so receivers check the record at that name and never read the one at example.com:

newsletter-subdomain.zone
news.example.com.  TXT  "v=spf1 include:spf.newsletter.example ~all"

It costs 1 if the newsletter’s record holds only ip4 terms, and adds nothing to the count at example.com, since each check starts at the return address’s domain. DMARC can still count this pass for a From address at example.com, as the last section explains.

A domain that never sends mail, 0 lookups:

no-mail-domain.zone
example.org.  TXT  "v=spf1 -all"
example.org.  MX   0 .

With -all, every server gets fail. The second line is a null MX, which says the domain accepts no mail (RFC 7505 §3), so publish it only if the domain receives none either.

Common SPF errors and how to fix them #

Too many DNS lookups #

too-many-lookups.zone
example.com.  TXT  "v=spf1 a mx include:_spf.mailhost.example include:spf.helpdesk.example include:spf.shop.example include:spf.survey.example ~all"

Your record has 6 counted terms, and say the four services’ records add 2, 2, 1 and 0, so the check needs 11 lookups and ends in permerror. The fix replaces a and mx with the one address both pointed at and drops an unused survey tool, for a total of 8:

fewer-lookups.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.10 include:_spf.mailhost.example include:spf.helpdesk.example include:spf.shop.example ~all"

See SPF PermError: too many DNS lookups.

Too many void lookups #

void-lookups.zone
example.com.  TXT  "v=spf1 a:mail.example.com a:mail2.example.com a:mail3.example.com mx:old.example.net include:_spf.mailhost.example ~all"

mail2 and mail3 were deleted and old.example.net has no MX records, so the record makes 3 void lookups against a limit of 2. The fix drops the three dead terms:

no-void-lookups.zone
example.com.  TXT  "v=spf1 a:mail.example.com include:_spf.mailhost.example ~all"

See SPF void lookup limit exceeded.

More than one SPF record #

two-records.zone
example.com.  TXT  "v=spf1 include:_spf.mailhost.example ~all"
example.com.  TXT  "v=spf1 include:spf.crm.example ~all"

Two records that start with v=spf1 at one name give permerror, however correct each one is. Merge them into one record with one all:

one-record.zone
example.com.  TXT  "v=spf1 include:_spf.mailhost.example include:spf.crm.example ~all"

See Multiple SPF records found.

An include with no SPF record #

typo-include.zone
example.com.  TXT  "v=spf1 include:_spf.mailhots.example ~all"

A typo points the include at a name with no SPF record, and an include whose target has none returns permerror (RFC 7208 §5.2). A service that retires its record does the same. Correct the name, or delete the include:

fixed-include.zone
example.com.  TXT  "v=spf1 include:_spf.mailhost.example ~all"

See SPF include has no SPF record.

+all lets every server pass #

plus-all.zone
example.com.  TXT  "v=spf1 include:_spf.mailhost.example +all"

With +all, any server on the internet passes SPF for your domain, and the include adds nothing. End the record with ~all or -all:

fixed-all.zone
example.com.  TXT  "v=spf1 include:_spf.mailhost.example ~all"

No all and no redirect #

no-all.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.10 include:_spf.mailhost.example"

Without an ending, a forger’s server gets neutral, so it’s treated as if you had no SPF record (how SPF works). Add an ending:

with-all.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.10 include:_spf.mailhost.example ~all"

The ptr mechanism #

ptr-term.zone
example.com.  TXT  "v=spf1 ptr:example.com include:_spf.mailhost.example ~all"

RFC 7208 §5.5 says ptr should not be published: it’s slow, less reliable when DNS has errors, and a heavy load on the reverse DNS servers. If the reverse lookup fails, ptr doesn’t match, and the servers it was meant to cover fall through to ~all. List them by address instead:

ip-range.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.0/28 include:_spf.mailhost.example ~all"

A syntax error #

syntax-error.zone
example.com.  TXT  "v=spf1 ipv4:192.0.2.10 include:_spf.mailhost.example ~all"

ipv4 isn’t a mechanism. A syntax error anywhere in the record gives permerror before any term is evaluated (RFC 7208 §4.6), so the correct include stops working too.

fixed-syntax.zone
example.com.  TXT  "v=spf1 ip4:192.0.2.10 include:_spf.mailhost.example ~all"

A record over the size guidance #

over-size.zone
example.com.  TXT  ( "v=spf1 ip4:198.51.100.16 ip4:198.51.100.17 ip4:198.51.100.18 ip4:198.51.100.19 ip4:198.51.100.20 ip4:198.51.100.21 ip4:198.51.100.22 ip4:198.51.100.23 ip4:198.51.100.24 ip4:198.51.100.25 ip4:198.51.100.26 ip4:198.51.100.27 ip4:198.51.100.28 "
                     "ip4:198.51.100.29 ip4:198.51.100.30 ip4:198.51.100.31 ip4:203.0.113.32 ip4:203.0.113.33 ip4:203.0.113.34 ip4:203.0.113.35 ip4:203.0.113.36 ip4:203.0.113.37 ip4:203.0.113.38 ip4:203.0.113.39 include:_spf.mailhost.example include:spf.crm.example ~all" )

The two strings make one record of 489 characters, past the 450 that RFC 7208 §3.4 suggests. The 24 single addresses fill two exact ranges, a /28 and a /29, which cover the same addresses in a record of 106 characters:

smaller-record.zone
example.com.  TXT  "v=spf1 ip4:198.51.100.16/28 ip4:203.0.113.32/29 include:_spf.mailhost.example include:spf.crm.example ~all"

How to publish or change your SPF record #

The same steps apply wherever your DNS is hosted:

  1. Sign in where your domain’s DNS is hosted, which may not be where you bought the domain. The SPF record lives there, not in your mail service.
  2. Look for a TXT record at the domain itself that starts with v=spf1. If there is one, edit it and add the new include before all, and never add a second SPF record next to it. If there’s none, add one like the record in the table below.
  3. Keep a service you’re dropping in the record until no mail goes out through it. RFC 7208 §2.1 asks for a transition period, so the old policy stays valid until mail already on its way has been checked.
  4. Note the TTL: other servers may keep the old record that long before they look again (RFC 1035 §3.2.1).
  5. Run the checker above once the change is live.
An SPF record as a DNS host's form asks for it
Type Name (Host) Value TTL
TXT @ v=spf1 include:_spf.mailhost.example ~all 3600 (one hour)

Each host and service documents its own steps:

  • Cloudflare. Go to the DNS Records page, select Add record, choose the type, fill in the fields and select Save, or select Edit on an existing record (Manage DNS records).
  • GoDaddy. In your Domain Portfolio, select the domain, then DNS, then Add New Record, and choose TXT. GoDaddy says the domain must use GoDaddy name servers, and most updates take effect within an hour but can take up to 48 hours (Add an SPF record).
  • Namecheap. For domains on BasicDNS, PremiumDNS or FreeDNS, open Domain List, select Manage, go to Advanced DNS and select Add new record. Choose TXT Record, paste the record into Value and select Save all changes; new records normally take effect in 30 minutes (Add TXT/SPF/DKIM/DMARC records).
  • Amazon Route 53. In the console, choose Hosted zones, your zone, then Create record (Creating records). Use TXT, not the SPF type, which AWS no longer recommends. With simple routing, all TXT values for a name go in one record: put the strings of one long value on the same line, and give each other TXT value its own line (Supported DNS record types).
  • Google Workspace. If Google Workspace is the only service that sends your mail, Google gives v=spf1 include:_spf.google.com ~all, recommends ~all, and says SPF can take up to 48 hours to start working (Set up SPF).
  • Microsoft 365. When Microsoft 365 is a custom domain’s only mail source, Microsoft gives v=spf1 include:spf.protection.outlook.com -all (GCC High, DoD and 21Vianet use other values) and recommends -all, since it also recommends DKIM and DMARC. Microsoft 365 has no SPF setting of its own, and Microsoft suggests a TTL of at least 3,600 seconds (Set up SPF).
  • Zoho Mail. Zoho gives v=spf1 include:zohomail.com -all, or include:one.zoho.com for several Zoho services, and says ~all also works. Check it in the Admin Console under Domains, Email Configuration, SPF, Verify SPF Record (SPF configuration).
  • Amazon SES. SES uses a subdomain of amazonses.com as the default MAIL FROM domain, so SPF passes without a record of yours (Authenticating Email with SPF). A custom MAIL FROM domain is a subdomain of yours, used for nothing else, with an MX record 10 feedback-smtp.<region>.amazonses.com and a TXT record "v=spf1 include:amazonses.com ~all". For that SPF record to count toward DMARC, AWS says the From domain must match the MAIL FROM domain (Custom MAIL FROM domain).

How SPF works with DKIM, DMARC and MX #

DMARC ties SPF to the From address readers see: a message passes when SPF or DKIM passes for a domain aligned with the From domain. In DMARC’s default relaxed mode the two need only the same Organizational Domain, so news.example.com aligns with example.com, and in strict mode they must be identical (RFC 9989 §3.2.10, §4.7). RFC 9989 replaced the older DMARC standard, RFC 7489, in May 2026.

From SPF, DMARC takes only the MAIL FROM check, and the domain counts only when that check passes (RFC 9989 §4.4.2), so softfail and fail look the same to it.

For DKIM, the domain DMARC aligns is the one in the signature’s d= tag (RFC 9989 §3.2.3), and DKIM is the safety net for forwarded mail. A forwarder that keeps your return address delivers the message from its own IP address, so the final receiver’s SPF check fails (RFC 7208 §10.3). A DKIM signature travels inside the message and is checked against a public key published under the signing domain, not against the delivering server, so a forward that leaves the message unchanged keeps it valid (RFC 6376 Appendix B.2.2).

The mx mechanism and your MX records point in opposite directions. MX records tell other servers where to deliver mail for your domain (RFC 5321 §5.1), and mx authorizes those same servers to send as your domain.

That only helps if your incoming servers also deliver your outgoing mail; otherwise it costs a lookup for servers that never send. With no MX records, mx matches nothing, because SPF doesn’t fall back to the domain’s own address the way mail delivery does (RFC 7208 §5.4).

Frequently asked questions

How long does an SPF change take to show up?

It depends on the TTL of the record you replaced. Servers that looked up the old record may keep their copy until its TTL runs out, so with a TTL of 3,600 seconds it can take up to an hour after your DNS host publishes the change. This checker also keeps each result for up to 5 minutes, so wait that long before you check the same domain again.

Should my SPF record end in ~all or -all?

Both are fine once every service that sends your mail is listed. With -all an unlisted server gets fail, which receivers may reject; with ~all it gets softfail, which they shouldn't reject on that alone. DMARC treats the two the same, because only an SPF pass counts there. The risk with -all is that some receivers check SPF before DMARC, so a hard fail can bounce a message that an aligned DKIM signature would have carried. If you're not sure the list is complete, start with ~all and move to -all once your DMARC reports show every service passing.

What is SPF flattening, and should I use it?

Flattening replaces includes with the ip4 and ip6 addresses they lead to, which cost no lookups. It gets a record under 10, but your copy goes stale when a provider changes its servers, and that provider's mail fails SPF until someone updates it. Remove includes you no longer use, or move a service to its own subdomain, before you flatten.

My SPF record is longer than 255 characters. Is that a problem?

Not if it's published as several quoted strings of up to 255 characters each, inside one TXT record. Receivers join the strings without adding anything, so the space between two terms has to sit inside a string: at the end of one or the start of the next. The size guidance still applies to the whole record: answers under 512 octets and records under about 450 characters.

Do I need an SPF record of type SPF (type 99)?

No. The dedicated SPF record type, code 99, is no longer used for SPF version 1, and receivers only look up TXT records. Publish your record as TXT. Receivers don't read a leftover type 99 record, so you can delete it.

Why does another SPF checker count a different number of lookups?

Common reasons are: whether the tool follows nested includes, whether it counts each MX host behind an mx term toward the 10, and when it ran, because the records your includes point to can change at any time. This checker follows every include and redirect and counts the six terms RFC 7208 lists: include, a, mx, ptr, exists and redirect.

Does email forwarding break SPF?

It can. A forwarder that keeps your return address delivers your message from its own server, which your record doesn't list, so SPF fails at the final receiver. A DKIM signature survives a forward that leaves the message unchanged, so an aligned DKIM signature keeps that mail passing DMARC.

Do subdomains need their own SPF record?

Yes, every name used in a return address needs its own. Receivers look up the SPF record at that exact name and don't fall back to the parent domain, so a record at example.com doesn't cover news.example.com. A subdomain that never sends mail can publish v=spf1 -all.

Does a domain that never sends mail need an SPF record?

Yes. Publish v=spf1 -all, which lists no servers, so every message with the domain in its return address gets an SPF fail. RFC 7208 calls this a well-established best practice. If the domain receives no mail either, publish a null MX record too.

Is the SPF checker free, and what happens to the domains I check?

It's free, with a daily allowance of checks per network. If you need more, the same check is available through the Kavik.email API. The domains you enter are used to run the check, held with the result for up to 5 minutes, and otherwise kept only in routine server logs.

Records look right? Check the list next.

Kavik.email checks every address on your list, so what you send reaches real inboxes.