SPF Record Checker and Generator
Check your SPF record, count every DNS lookup through all includes (the limit is 10), and see the full include tree. Then build a new record below if you need one.
No account needed. Reads public DNS only, live. Nothing you check is saved.
How to use this tool
- Enter your domain. The tool finds the SPF record and walks every
include:andredirect=. - Look at the lookup count. 10 or less is fine. Over 10 gives SPF PermError and receivers treat your mail as failing.
- Need a new record? Use the generator under the checker. Pick your mail services and copy the TXT record.
The 10 lookup limit
Each include, a, mx, exists and redirect costs a lookup, and includes inside includes count too. Microsoft 365 alone uses 2, Google 4, and many marketing tools add 2 or 3 each. That is how domains go over without noticing.
To get back under: remove services you no longer use, swap a and mx for ip4: ranges, and move bulk senders to a subdomain with its own SPF.
Microsoft 365, Google and one more tool = over 10
include:spf.protection.outlook.com costs about 2 lookups, include:_spf.google.com about 4. Add a CRM, a helpdesk and a newsletter tool at 2 or 3 each, and you pass 10. Receivers then return PermError and DMARC counts it as a fail.
Fix in this order: remove services you stopped using, remove duplicate Microsoft includes (only spf.protection.outlook.com is needed), move bulk mail to a subdomain like news.example.com with its own SPF.
Do not flatten the Microsoft or Google includes into IP lists. Their IPs change, and a flattened record silently goes stale.
SPF record guide: syntax, limits and fixes
What is an SPF record?
An SPF record is one TXT record on your domain that lists the servers allowed to send mail as you. It starts with v=spf1, lists sources like include: and ip4:, and ends with ~all or -all. Receivers compare the sending IP with that list.
SPF record example for Microsoft 365, Google Workspace and both
Microsoft 365 only: v=spf1 include:spf.protection.outlook.com -all. Google Workspace only: v=spf1 include:_spf.google.com ~all. Both, plus a newsletter tool: v=spf1 include:spf.protection.outlook.com include:_spf.google.com include:servers.mcsv.net ~all.
Use the generator under the checker to build yours. Pick the services, copy the line, and publish it as a TXT record at the root of the domain (host @).
How to check an SPF record
Type the domain above. The checker finds the record, checks the syntax, counts lookups and draws the include tree. From a terminal: dig TXT example.com +short | grep spf, or on Windows nslookup -type=txt example.com.
SPF too many DNS lookups (PermError)
The SPF 10 lookup limit counts every include, a, mx, exists and redirect, plus the ones inside each include. Go over 10 and receivers return permerror, which DMARC treats as a fail. This is the most common SPF problem we see.
How to fix too many DNS lookups: remove services you no longer use, delete duplicate includes, replace a and mx with your fixed ip4: addresses, and move bulk senders to a subdomain with its own record. SPF flattening (turning includes into IP lists) works for small stable senders, but not for Microsoft or Google, their IPs change.
Multiple SPF records found
A domain can have only one SPF record. Two TXT records that start with v=spf1 give a permanent error, even if each one is correct. Merge them: keep one v=spf1 at the start, put every include in the middle, one all at the end.
SPF ~all vs -all
~all is soft fail: unlisted senders are marked, not blocked. -all is hard fail. With DMARC in place most receivers act on DMARC, not on this flag, so the difference is smaller than people think. Start with ~all, move to -all once reports show every real sender passes. Never use +all, it lets anyone send as you.
SPF record not found or SPF none
Usually the record is on the wrong name (www instead of the root), typed as an SPF record type instead of TXT (the SPF type is obsolete), or not propagated yet. Some panels need the host field empty, some need @.
SPF softfail and fail in email headers
In headers you will see spf=pass, softfail, fail, neutral, none or permerror. Softfail or fail means the sending server is not in your record: add that service include. Check the IP shown in the header, then search which service owns it.
SPF void lookups
An include that points to a domain with no SPF record is a void lookup. More than 2 can also trigger PermError. The checker flags includes that return nothing, often left over from a service you cancelled.
Does SPF work with forwarding?
No. When mail is forwarded, the forwarder IP is not in your SPF, so SPF fails at the final receiver. That is why DMARC accepts DKIM as the other way to pass. Make sure DKIM is set up too.
SPF record for a subdomain
SPF does not inherit. news.example.com needs its own record if it sends mail. A subdomain that never sends should get v=spf1 -all so nobody can abuse it.
SPF record length limit
One TXT string can hold 255 characters. A longer SPF record must be split into several quoted strings in the same record, which most DNS panels do for you. The whole DNS answer should stay under about 450 bytes to avoid problems over UDP.
SPF record for GoDaddy, Cloudflare and other DNS hosts
Add a TXT record with host @ (Cloudflare shows the domain name), value v=spf1 ... ~all. If one exists already, edit it instead of adding a second. Some panels add quotes for you, do not add your own.
SPF include for common services
Microsoft 365 spf.protection.outlook.com, Google _spf.google.com, Mailchimp servers.mcsv.net, SendGrid sendgrid.net, Amazon SES amazonses.com, Zoho zoho.com. Check each service help page, some use a per account include.
SPF neutral (?all)
?all says nothing about unlisted senders, it is as good as no policy. Use ~all or -all.
Check SPF with an email test
Send a mail to a Gmail address, open Show original and read the SPF line. It shows pass or fail and the IP that was checked. Then look up that IP to find which service sent it.
SPF macros and exists mechanism
Advanced setups use exists: with macros like %{i} for the sending IP. Some SPF flattening services rely on it. Each exists costs a lookup like an include.
SPF and DMARC together
SPF on its own does not protect the From address people see. With DMARC, SPF must pass and align with the From domain. That alignment is checked on the Return-Path domain, which third party senders often set to their own.
Frequently asked questions
I have two SPF records
That is an error on its own, receivers give PermError. Merge them into one TXT record that starts with v=spf1.
-all or ~all?
~all (soft fail) is safe while you set things up. Move to -all once DMARC reports show every real sender passes.
Does SPF alone stop spoofing?
No. SPF checks the hidden envelope sender, not the From address people see. You need DMARC for that.
Related tools
- DMARC checker: the policy that makes SPF count
- DKIM checker: the signature side
- SPF, DKIM and DMARC generator: build all three records