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.

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
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
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
| Result | Meaning |
|---|---|
| pass | Record published and evaluated within limits (receiver still decides policy) |
| fail | IP or sender not authorized |
| softfail | ~all or weak fail mechanism |
| permerror | Syntax error, multiple records, or lookup limit exceeded |
| none | No 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
dig and nslookup show raw TXT; confirm exactly one `v=spf1` row.Expand includes manually or use a lookup-counting validator; permerror hides behind pretty strings.
PowerShell Resolve-DnsName fits Windows-first admin teams.
permerror and duplicate records fail authentication even when the record "looks fine."
Re-run checks after vendor integrations, not just once a year at audit time.
Share this analysis
Help others discover this content
More from our blog

SPF Flattening: When It Helps and Hurts
SPF flattening replaces includes with IP lists to stay under the 10-lookup cap. Learn when flattening services help, when they cause permerror, and safer alternatives.

Google Workspace SPF Record Mistakes
Google Workspace SPF setup: the correct include:_spf.google.com line, Mailchimp and HubSpot add-ons, and the migration mistakes that leave DMARC failing while Admin looks green.

SPF Record Syntax: Complete Reference
SPF record syntax from v=spf1 through -all: includes, lookup limits, permerror traps, and provider templates. The reference we use before editing any production TXT record.