Back to blog
SPF

How to Check an SPF Record (3 Ways)

A lookup tool tells you the record exists. It does not tell you the record works, and that gap is where most SPF failures hide.

ZeroHook
ZeroHook Team
Security Analysts
Nov 7, 2026~4 min read
How to Check an SPF Record (3 Ways)
Three sales reps filed tickets the same morning while dig showed a textbook `v=spf1` string, and nobody counted includes until Gmail started returning permerror on lookup eleven.

Your SPF Record Can Be Valid and Still Fail

SPF fails two completely different ways, and the obvious ones (missing record, bad syntax, a typo in a mechanism) are what any checker catches on the first pass.

The sneaky failure? Syntactically perfect TXT that still returns permerror at the receiver. Dig won't scream. You have to count.

What actually breaks

Every `include:`, `a`, `mx`, `ptr`, `exists:`, and `redirect=` in your record costs a DNS lookup. So does every one of those mechanisms inside the records you include. One `include:_spf.google.com` expands into more lookups on its own. Stack Google Workspace, a marketing platform, a ticketing system, and payroll on one domain and you cross 10 without ever touching your own TXT record.

Warning

When SPF returns permerror, receivers don't fall back to a soft pass. Gmail and Microsoft treat it as an authentication failure, and if DMARC alignment depends on SPF, the whole message fails DMARC with it.

That sounds fine until it isn't: your domain may publish only one SPF record. Two TXT records both starting with `v=spf1` is an automatic permerror, and we usually see it when one team adds an ESP include while another edits the existing record.

Method 1: Check an SPF Record With dig or nslookup

Fastest way to see raw truth. No tool interpreting anything for you.

Now do the part everyone skips

On macOS or Linux, run `dig +short TXT example.com`. On Windows, `nslookup -type=txt example.com` works without extra installs. You get back the TXT records for the domain. The one you want starts with `v=spf1`. Two of them? Stop. Merge first.

Take each `include:` in the result and query it the same way, then chase includes inside those rows (`dig +short TXT _spf.google.com`, then `spf.protection.outlook.com`, and so on). Count mechanisms until you hit 10. RFC 7208 section 4.6.4 is the hard stop.

Method 2: PowerShell on Windows Server

If you live in Microsoft 365 admin land and already have PowerShell open, run `Resolve-DnsName -Name example.com -Type TXT` and read the Strings property for the line starting with `v=spf1`. Same rule as dig: one record only, then manual include expansion if you're debugging permerror.

Pro tip

Exchange hybrid setups sometimes still publish an on-prem include next to `spf.protection.outlook.com`. Merge carefully; duplicate `v=spf1` rows from different teams is the usual permerror source.

Method 3: SPF Validator That Counts Lookups

Syntax-only checkers green-light records that blow the lookup cap. Use a validator that reports lookup count and flags duplicate SPF TXT rows.

Run your domain at zerohook.org/spf-checker after every DNS change. Fix permerror before you argue with marketing about subject lines.

How to read the output

ResultMeaning
passRecord published and evaluated within limits (receiver still decides policy)
failIP or sender not authorized
softfail~all or weak fail mechanism
permerrorSyntax error, multiple records, or lookup limit exceeded
noneNo SPF record published
“Seeing v=spf1 in dig is step one. Lookup count is step two. Most tickets stop after step one.”

Frequently Asked Questions

Key takeaways

1
dig and nslookup show raw TXT; confirm exactly one `v=spf1` row.
2

Expand includes manually or use a lookup-counting validator; permerror hides behind pretty strings.

3

PowerShell Resolve-DnsName fits Windows-first admin teams.

4

permerror and duplicate records fail authentication even when the record "looks fine."

5

Re-run checks after vendor integrations, not just once a year at audit time.

Count lookups and catch duplicate TXT rows on zerohook.org/spf-checker before the next ESP integration pushes you past ten.

Share this analysis

Help others discover this content

Fix DNS before the next audit
Provider-specific copy-paste fixes for Cloudflare, Route53, GoDaddy, and more.
Start free scan

More from our blog