To check an SPF record, run dig +short TXT yourdomain.com on macOS or Linux, nslookup -type=TXT yourdomain.com on Windows, or use a free online SPF checker. Look for exactly one TXT record starting with v=spf1, confirm it lists every service that sends mail for your domain, and check that resolving it needs no more than 10 DNS lookups. Then send a test email to Gmail and confirm spf=pass in the message headers.
Key takeaways
- One dig or nslookup command shows your SPF record — look for exactly one TXT record starting with v=spf1.
- The RFC 7208 limit is 10 DNS lookups: too many include: entries return PermError and SPF fails.
- The final proof is a real email: check for spf=pass in the Authentication-Results header in Gmail.
SPF is the first line of defense against email spoofing — a single DNS record that says which servers may send mail for your domain. Checking it takes about thirty seconds, and the result tells you whether your mail is authenticated or silently failing. Here is how to check it on any system, read the result, and fix the errors that break it.
What is an SPF record?
An SPF (Sender Policy Framework) record is a TXT record in your domain's DNS that declares which servers and services are allowed to send email on behalf of your domain. When a receiving mail server gets a message, it looks up your SPF record and checks whether the sending server is on the list.
SPF is defined in RFC 7208. The record always starts with v=spf1 and lists mechanisms — include: for a provider, ip4: for a specific address, mx for your mail servers — followed by a closing qualifier such as -all or ~all. A typical record for a business on Google Workspace that also sends newsletters looks like this: v=spf1 include:_spf.google.com include:servers.mcsv.net ~all.
How do you check an SPF record in 30 seconds?
Use a free online checker: enter your domain and it reads the TXT record, resolves every include, counts DNS lookups against the limit of 10 and rates the closing qualifier. Our free SPF checker does exactly this, with no account needed.
The online check is the fastest method and the one most people should use. The command-line methods below show the raw DNS answer, which is useful when you need to see exactly what a receiving server sees, or when you suspect caching is hiding a change.
How do you check an SPF record with dig?
On macOS or Linux, open Terminal and run dig +short TXT example.com, replacing example.com with your domain. The output lists every TXT record; the SPF record is the one starting with v=spf1.
To skip your computer's cache and ask public DNS directly, add a resolver: dig +short TXT example.com @8.8.8.8. To see the full answer including TTL, drop +short: dig example.com TXT +noall +answer. You can also check an included record the same way, for example dig +short TXT _spf.google.com @8.8.8.8.
How do you check an SPF record with nslookup on Windows?
On Windows, open Command Prompt and run nslookup -type=TXT example.com. The output lists every TXT record for the domain; look for the one starting with v=spf1. To query Google Public DNS instead of your default resolver, add it at the end: nslookup -type=TXT example.com 8.8.8.8.
On PowerShell, a cleaner option prints only the SPF record: Resolve-DnsName example.com -Type TXT | Where-Object { $_.Strings -match 'v=spf1' }. An empty result means your domain has no SPF record.
How do you read an SPF record?
Once you have the record, read it left to right. Each piece has a job, and most SPF failures come from one piece being wrong.
| Part | Meaning | Example |
|---|---|---|
| v=spf1 | Version tag, must come first | v=spf1 |
| include: | Pull in another domain's SPF record | include:_spf.google.com |
| ip4: / ip6: | Authorize a specific IP or range | ip4:203.0.113.10 |
| a / mx | Authorize the domain's A or MX servers | mx |
| -all | Hard fail: reject unlisted senders | -all |
| ~all | Soft fail: accept but mark suspicious | ~all |
| ?all | Neutral: no opinion on unlisted senders | ?all |
| +all | Pass everything — never use this | +all |
Two details matter most. First, include: pulls in a provider's whole SPF record — for example _spf.google.com for Google Workspace or spf.protection.outlook.com for Microsoft 365 — and each include costs DNS lookups. Second, +all authorizes every server on the internet and defeats the entire purpose of SPF; if you see it, remove it immediately.
What is the SPF 10 DNS lookup limit?
RFC 7208 limits SPF evaluation to 10 DNS lookups. The mechanisms that count are include, a, mx, ptr, exists and redirect — and the count is recursive, so the lookups inside an included record count toward your total. The mechanisms ip4, ip6 and all do not count, because they need no DNS query.
If evaluation would exceed 10 lookups, the implementation must return PermError — a permanent error, as Microsoft's SPF documentation explains. Receivers treat PermError as a failed SPF check, so your mail can land in spam or be rejected even though every sender is legitimate. The most common cause is sprawl: Google Workspace, Microsoft 365, a newsletter tool, a CRM, a ticketing system and an old hosting provider nobody removed.
How do you confirm SPF passes with a real email?
A DNS lookup proves the record exists. Only a real message proves it works. Send a test email from your domain to a Gmail account, then open the message, click the three-dot menu and choose "Show original". Look for the Authentication-Results header: you want spf=pass, with the domain of the envelope sender matching yours.
Test from every system that sends mail for your domain — Google Workspace, your newsletter tool, your CRM — because each one needs to be listed in the record. You can also paste the headers into our free email header analyzer to see the SPF, DKIM and DMARC verdicts in plain language.
What are the most common SPF record errors?
Most broken SPF records fail in one of six ways. Check for these before you look anywhere else.
- Two SPF records. A domain must have exactly one TXT record starting with
v=spf1. Two records cause a PermError. Merge them into one record listing all senders. - Too many DNS lookups. More than 10 lookups returns PermError. Remove unused includes, move bulk mail to a subdomain with its own record, or flatten includes into
ip4:andip6:addresses. - Missing sender. Your newsletter tool or CRM sends mail but is not in the record, so its messages fail SPF. Add its include or IP range.
- Stale include. An old provider you no longer use is still listed. Remove it — it wastes lookups and is a security risk.
- Syntax errors. A missing space, a typo in a domain name or a mechanism in the wrong place can invalidate the whole record. Use a checker to validate syntax.
+allor?allat the end. These authorize or excuse everyone. Use~allwhile testing and-allonce you are confident.
What SPF record do common providers need?
Every provider publishes the include you need. These are the common ones — always confirm the current value in the provider's own documentation, because providers change their SPF endpoints.
| Provider | SPF record (alone) |
|---|---|
| Google Workspace | v=spf1 include:_spf.google.com ~all |
| Microsoft 365 | v=spf1 include:spf.protection.outlook.com ~all |
| Google Workspace + newsletter tool | v=spf1 include:_spf.google.com include:servers.mcsv.net ~all |
When you combine providers, merge their includes into a single record and count the lookups. If the total creeps over 10, move one mail stream — usually bulk or transactional mail — to a subdomain such as mail.example.com, which gets its own fresh SPF record and its own 10-lookup limit.
Does SPF alone stop email spoofing?
No — and this is the most misunderstood part of email authentication. SPF checks the envelope sender domain, which is the return path used for bounces and is invisible to recipients. An attacker can pass SPF on their own domain while putting your domain in the visible From address.
That is why SPF must be combined with DKIM and DMARC. DKIM signs the message cryptographically, and DMARC aligns SPF and DKIM with the domain in the From address. Only DMARC at p=reject actually blocks spoofed mail.
Since February 2024, Gmail has required bulk senders — anyone sending 5,000 or more messages a day to personal Gmail accounts — to have SPF, DKIM and a DMARC record, and Microsoft introduced similar rules for high-volume senders in May 2025.
Our guide to what DMARC is and how to set it up walks through the safe path from p=none to p=reject.
You can check your own domain's status with the free DMARC checker.
The bottom line
Checking an SPF record is one command: dig +short TXT yourdomain.com or nslookup -type=TXT yourdomain.com. Look for exactly one record starting with v=spf1, confirm every sender is listed, stay under 10 DNS lookups, and prove it with a real email showing spf=pass.
Then do not stop there. SPF is one of three records — add DKIM and DMARC, and check the whole picture with our free SPF checker.
The email security score tool grades your domain across all three records at once.
Frequently asked questions
How do I check my SPF record?
Run dig +short TXT yourdomain.com on macOS or Linux, or nslookup -type=TXT yourdomain.com on Windows. You can also use a free online SPF checker. Look for exactly one TXT record starting with v=spf1 that lists every service sending mail for your domain.
What does a correct SPF record look like?
A correct record is a single TXT record starting with v=spf1, listing every authorized sender, resolving within 10 DNS lookups, and ending with -all or ~all. For Google Workspace alone it is: v=spf1 include:_spf.google.com ~all.
What is the SPF 10 DNS lookup limit?
RFC 7208 limits SPF evaluation to 10 DNS lookups. Each include:, a, mx, ptr, exists and redirect counts, including nested lookups inside included records. Exceeding the limit returns PermError, which most receivers treat as a failed SPF check.
Why does my domain have no SPF record?
Either no SPF record was ever published, or it was published on the wrong name. SPF lives as a TXT record on the domain itself — for example example.com — not on a subdomain. If dig shows no v=spf1 record, your domain has no SPF protection.
Can a domain have two SPF records?
No. A domain must have exactly one SPF record. Two TXT records starting with v=spf1 cause a PermError, and SPF fails for every message. Merge them into a single record that lists all your senders.
What is the difference between -all and ~all in SPF?
-all is a hard fail: receivers should reject mail from servers not listed in the record. ~all is a soft fail: receivers should accept but mark the mail as suspicious. Use ~all while testing, then move to -all once you are sure every sender is listed.
How long does it take for an SPF record change to take effect?
DNS changes propagate as old cached values expire, which depends on the record's TTL — often minutes to a few hours. Check against a public resolver such as 8.8.8.8 to see the current published value rather than your computer's cache.
Does SPF alone stop email spoofing?
No. SPF only checks the envelope sender domain, which recipients never see. It must be combined with DKIM and DMARC: DMARC aligns SPF with the domain in the From address, and only DMARC at p=reject actually blocks spoofed mail.
Sources
- IETF — RFC 7208: Sender Policy Framework (SPF)
- Google Workspace Help — Set up SPF
- Microsoft Learn — Set up SPF to identify valid email sources for your Microsoft 365 domain
- Google — Email sender guidelines
- Microsoft — Outlook's New Requirements for High-Volume Senders
- Postmark — Resolving SPF "Too Many DNS Lookups" Errors
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against RFC 7208, Google Workspace and Microsoft 365 SPF documentation, Google's email sender guidelines, and Postmark's SPF troubleshooting guide.
How we write and fact-check →