Skip to content
wonderstacked

How to Check Your SPF Record and Fix the Errors That Break It

By Divya · Updated

How to look up and read an SPF record, and how to fix the lookup-limit, duplicate-record and missing-include errors we found on Etsy, NPR and others.

Illustration of an envelope heading for a mail server, stopped at a barrier in front of a tall stack of blocks whose top block glows amber

I built Wonderstacked's SPF/DMARC Checker because email authentication is one of those things that's easy to get almost right, but surprisingly difficult to verify. You add a few DNS records, follow the instructions from your email provider, and assume everything is fine. Then a small mistake in one of those records quietly makes SPF fail for every message you send.

To check an SPF record, look up the TXT records on your domain and find the one that starts with v=spf1. Then confirm four things: there is only one such record, it ends in -all or ~all, every service that sends your mail is listed, and the whole record needs no more than 10 DNS lookups.

To see how often those checks fail on real domains, we ran the checker's code against the 1,000 most popular domains on the web. 27 of the 764 that publish SPF had a record that fails outright, including Etsy, eBay UK, the WHO and NPR. The sections below show what each error looks like and how to fix it.

How do I check my SPF record?

Enter your domain in the SPF/DMARC Checker. It fetches the SPF record, follows every include: down the tree, counts the DNS lookups, and lists anything that would make receivers reject the record. It also checks DMARC, DKIM at common selectors, MX, MTA-STS, TLS-RPT and BIMI in the same pass.

If you prefer the command line, these show the raw record:

# macOS / Linux
dig TXT example.com +short

# Windows
nslookup -type=txt example.com

Look for the line that starts with v=spf1. The command shows the record but doesn't open the includes inside it, so it can't tell you whether you're over the lookup limit. That limit causes most of the failures we found. To see every TXT record on the domain, not only SPF, use DNS Lookup.

What a valid SPF record looks like

An SPF record is a single TXT record on your domain that lists the servers allowed to send mail for it, then says what to do with everything else. A typical one for a small business looks like this:

v=spf1 include:_spf.google.com include:servers.mcsv.net ip4:203.0.113.10 -all

Each part has a job:

Term What it does Counts toward the 10-lookup limit?
v=spf1 Marks the record as SPF. Must come first. No
include: Pulls in another domain's SPF record, usually your email provider's Yes, plus everything inside it
a, mx Allows the IPs in your domain's A or MX records Yes
ip4:, ip6: Allows a specific address or range No
exists:, ptr Rarely needed. RFC 7208 says ptr should not be published. Yes
redirect= Uses another domain's SPF record instead of this one Yes
-all / ~all What to do with every sender not listed: fail or soft fail No

The lookup rule comes from RFC 7208, section 4.6.4. Receivers must stop after 10 DNS-querying terms and return a PermError, which means "this record is broken". Includes nested inside includes count too, which is why a record with six include: terms can still go over.

We checked the 1,000 most popular domains on the Tranco list (list 94LV2, generated on 3 December 2026) on 4 December 2026. 764 of them publish an SPF record. Here is how those 764 break down:

Result Domains
SPF fails outright (any of the three errors below) 27
Over 10 DNS lookups 20
Include that points at a name with no SPF record 5
Two SPF records 3
At 9 or 10 lookups, one include away from failing 65
Ends in -all 440
Ends in ~all 274
Ends in ?all (neutral, gives no protection) 18

The domains over the limit include pubmatic.com (24 lookups), teads.tv (20), dyndns.org (16), applovin.com (14), who.int (13), etsy.com (11) and ebay.co.uk (11). The median record needs 3 lookups, so most domains are nowhere near the limit.

Why does SPF fail with a PermError?

A PermError means the receiving server couldn't evaluate your SPF record at all, so SPF can't vouch for any message you send. These are the three causes we found, from most to least common.

Too many DNS lookups

This was the most common error in our scan: 20 domains. It's easy to overlook until something stops working, because every service you add asks you to add one more include:, and DNS itself doesn't warn you when the total passes 10.

Etsy is a clear example. Its record has nine include: terms and one a: term, and one of those includes (spf.redpoints.com) includes _spf.google.com in turn. That makes 11 lookups:

The Wonderstacked SPF/DMARC Checker showing etsy.com at 11 of 10 DNS lookups, with a warning that SPF will fail with a PermError and the full include tree below it

The tree also shows the easiest fix. _netblocks3.google.com currently contains no addresses at all (v=spf1 ~all), so removing that one include would bring Etsy back to exactly 10 without blocking any sender.

To get under the limit on your own domain:

  1. Remove services you no longer use. Every include for a tool you've stopped using still costs lookups.
  2. Remove duplicates. In our scan, 10 domains included the same provider twice, for example spf.protection.outlook.com on msn.com. Each copy costs lookups.
  3. Replace a and mx with ip4: ranges if your own servers send mail from fixed addresses. IP ranges cost nothing.
  4. Move bulk senders to a subdomain. Send newsletters from news.example.com with its own SPF record, so they don't use up the main domain's budget.
  5. Flatten as a last resort. Flattening means copying a provider's IP ranges into your record instead of including it. It saves lookups, but when the provider changes its IPs your copy goes stale and mail from the new addresses fails SPF until you update it.

An include that points at nothing

Five domains in our scan include a name that has no SPF record. Under RFC 7208 (section 5.2), an include that finds no SPF record makes the whole check return a PermError, even when the rest of the record is fine.

NPR's record includes c9eb27a2d7.berenice.eoidentity.com, which returns NXDOMAIN (the name doesn't exist):

The SPF/DMARC Checker for npr.org warning that c9eb27a2d7.berenice.eoidentity.com has no SPF record, above NPR's long SPF record and its includes

The others were mobile.de, withgoogle.com and gcdn.co (also NXDOMAIN), and dyndns.org, whose include target returned a server error instead, which gives a TempError rather than a PermError. If the include belongs to a vendor you've stopped using, delete it. If you still use the vendor, replace it with the include address they currently give you.

Two SPF records on one domain

One mistake worth highlighting is publishing multiple SPF records for the same domain. People set up Google Workspace, then add another SPF record for their newsletter provider, and another for their transactional email service. They assume each service needs its own record. But SPF doesn't work that way. You need to combine the authorised senders into a single SPF record, because a receiver that finds two v=spf1 records returns a PermError.

Three domains in the scan had this problem. indiatimes.com publishes these two:

v=spf1 include:tilc.in -all
v=spf1 include:_rng3.indiatimes.com include:_rng2.indiatimes.com include:tilc.in -all

The SPF/DMARC Checker warning that indiatimes.com publishes 2 SPF records and that receivers return a permanent error

The fix is to merge them into one record with every sender in it, then delete the extra TXT record. Here the second record already contains everything in the first, so deleting the first one is enough.

Should I use ~all or -all?

RFC 7208 defines -all as a "fail", an explicit statement that any server not listed is not allowed to send for you. ~all is a "softfail", which the RFC describes as "probably not authorized" and says receivers should treat as somewhere between fail and neutral.

I don't think there's one answer that should be blindly applied to every domain. During initial setup, or while you're still finding all your legitimate sending services, ~all can be a reasonable temporary choice. Once you're confident that every legitimate sender is covered, I'd prefer -all. The important thing is knowing what those mechanisms mean and making the decision deliberately. Leaving ~all forever just because it feels safer isn't necessarily a good approach either.

Among the 764 domains with SPF in our scan, 440 end in -all and 274 in ~all. Of the 18 that end in ?all (neutral), 8 are Google domains such as gstatic.com, and the rest include stanford.edu, washington.edu and bsky.app. 11 of the 18 have mail servers, and for those domains ?all gives no protection against spoofing.

What an SPF checker can't tell you

I'd tell people not to treat any checker, ours included, as a guarantee that their emails will reach the inbox. A checker reads public DNS records. It doesn't know every service you send through, whether those services are aligned with your domain for DMARC, or how a particular receiving server will treat a particular message. I also wouldn't blindly change DNS records just because a tool flags something.

Some specific limits of ours:

  • SPF macros. 33 of the top 1,000 domains, including zoom.us, ibm.com and booking.com, use an include like %{ir}.%{v}.%{d}.spf.has.pphosted.com. The %{...} parts are filled in with the sending server's IP address at delivery time (RFC 7208, section 7), so no checker can evaluate them without a real message. Our checker currently reports these as "has no SPF record", which is wrong for these domains.
  • Void lookups. RFC 7208 also limits lookups that return nothing to two. Our checker doesn't count those yet.
  • The real result. Only a delivered message shows what the receiver decided. Send yourself a test email, open the original headers, and paste them into the Email Header Analyzer. Look for spf=pass in the Authentication-Results line.

How to confirm the fix worked

After you change the record, wait for the old one to expire from DNS caches. The TTL on the TXT record, which DNS Lookup shows, is the number of seconds that takes. Then run the SPF/DMARC Checker again and check that the lookup count is 10 or under and the warnings are gone. Finally, send a test message to an outside address, such as a personal Gmail account, and confirm the headers show spf=pass. If they show spf=permerror, the receiver still sees a broken record. Look for a second v=spf1 record with DNS Record Checker, or for an include you missed.

How we tested

  • Sample: the top 1,000 domains on Tranco list 94LV2 (30-day window ending 3 December 2026).
  • Date: 4 December 2026.
  • Method: we ran the same SPF and DMARC analysis code that powers the SPF/DMARC Checker on every domain, answering its DNS queries through Cloudflare's public resolver. A lookup that failed was treated as empty, as the live tool does.
  • Checks, set before the scan: whether SPF is present, how many SPF records there are, the all qualifier, DNS lookups counted across every include and redirect, include targets with no record, ptr use, record length, and DMARC presence and policy.
  • Cross-check: we recounted the over-limit, duplicate-record and broken-include cases with a separate counter written from RFC 7208, using Google's public resolver. Every count matched.

DNS changes constantly, so a domain listed here may have fixed its record since 4 December. Run the checker on it to see its current state.

Check your own domain's lookup count today. If it's 9 or 10, the next email service you add will push it over the limit and break SPF for all your mail, so make room first.

Frequently asked questions

What does "sender failed SPF validation" mean?

The receiving mail server compared the IP address that sent the message with the sender domain's SPF record, and either the IP wasn't listed or the record itself had an error. Paste the message headers into the Email Header Analyzer to see the exact SPF result the receiver recorded.

How many SPF records can a domain have?

One. RFC 7208 says a domain with more than one v=spf1 TXT record returns a PermError, so receivers treat SPF as broken. Put every sender into a single record.

Can I check an SPF record without an online tool?

Yes. Run dig TXT example.com +short on macOS or Linux, or nslookup -type=txt example.com on Windows, and look for the line starting with v=spf1. That shows the record but doesn't follow includes or count lookups.

Is DMARC really necessary if SPF passes?

SPF on its own tells receivers which servers may send for you, but not what to do when a message fails, and it sends you no reports. DMARC adds both. In our scan, 733 of the top 1,000 domains published a DMARC record, and 436 of those used p=reject.

What is the difference between SPF and DKIM?

SPF lists the servers allowed to send mail for your domain. DKIM signs each message with a key published in your DNS, so the receiver can check the message wasn't changed and really came from you.

Divya, Software engineer

Software engineer who writes practical guides on web tools. Outside work, she cooks and explores new dishes.

Tools mentioned in this guide

esc