Log in Sign up
SPF check

Look up a domain's SPF record and count its DNS lookups

Enter a domain to run an SPF check. The tool looks up the SPF record, follows each include and redirect, and counts DNS lookups against the limit of 10. It flags duplicate records, includes that point to a domain without SPF, a missing all rule and +all.

Your browser sends the query straight to Cloudflare DNS, with Google DNS as a fallback. Our server does not see it.

SPF record generator

Tick the services that send mail for your domain and add your own servers.

Mail services
Own servers

Publish this TXT record at the domain root (host @)

v=spf1 ~all

A message passes the SPF check: the sending server is matched against the allowed list

How SPF works

SPF (Sender Policy Framework) lets you list the servers allowed to send mail for your domain in a DNS TXT record. A receiving server takes the domain from the envelope sender, the Return-Path, reads its SPF record and checks whether the connecting IP is on the list. The final all rule decides what happens to mail from servers not on the list.

Each include, a, mx, ptr, exists and redirect costs one DNS lookup, and the lookups inside nested includes count toward the same total. Past 10 lookups the receiver stops with a permerror, and mail from your domain fails SPF even when it comes from an allowed server. The checker above adds up lookups across all levels of the include tree.

Reasons to run an SPF check

  • Verify the SPF record after you connect Google Workspace, Microsoft 365 or a newsletter service
  • Find out why mail from a new sending service fails SPF or lands in spam
  • Merge two SPF records that different providers asked you to publish
  • Trim a record that grew past 10 DNS lookups

SPF record syntax: mechanisms, qualifiers and modifiers

An SPF record is one line of terms separated by spaces, and it must start with v=spf1. Mechanisms match the sending IP. ip4:203.0.113.0/24 and ip6:2001:db8::/32 list addresses and cost no DNS lookups. a and mx match the addresses of the domain's A or MX hosts, include:_spf.google.com runs the SPF check of another domain, and exists and the deprecated ptr cover rare cases. Each of these five costs one lookup. all matches any sender and goes last. A qualifier in front of a mechanism sets the result on a match: + pass (the default), - fail, ~ softfail, ? neutral. The modifier redirect=_spf.example.com hands the check to another record and costs one lookup; receivers ignore it when the record has an all term. A receiver returns permerror on a term it does not recognize, such as the typo inlcude:. This checker skips unknown terms, so the typo shows up as a missing branch in the include tree and a lower lookup count.

SPF record examples for Google Workspace, Microsoft 365 and bulk senders

Google Workspace alone: v=spf1 include:_spf.google.com ~all. Microsoft 365 (Office 365): v=spf1 include:spf.protection.outlook.com -all. SendGrid uses include:sendgrid.net, Mailgun include:mailgun.org and Amazon SES include:amazonses.com. Zoho Mail's setup guide gives include:zohomail.com, or a regional domain such as zohomail.eu for accounts in the EU data center. A domain with Google Workspace for staff mail, SendGrid for newsletters and its own server at 203.0.113.10 needs one combined record: v=spf1 ip4:203.0.113.10 include:_spf.google.com include:sendgrid.net ~all. Amazon SES, Mailgun and SendGrid often send with a Return-Path on a subdomain such as bounce.example.com or mg.example.com. Receivers check SPF on that subdomain, so you publish the provider's record (or the CNAME it gives you) there, and the root record may not need that include at all. Compare each value with your provider's DNS setup page before you publish.

SPF check results: pass, fail, softfail, neutral and permerror

A receiver ends the SPF check with one result. pass means the IP matched a term with the + qualifier. fail means it matched a - term, usually -all, and many receivers reject the message. softfail comes from ~all: the receiver accepts the mail and may route it to spam. neutral comes from ?all and carries no verdict. none means the domain has no SPF record. permerror means the record is broken: two v=spf1 records, more than 10 lookups or a term the receiver cannot parse. temperror means a DNS timeout or server error. The checker above shows which all rule your record ends with and follows redirect when the record has no all term.

SPF record questions

01What is an SPF record?

An SPF record is a TXT record in DNS that names the servers allowed to send mail for a domain. It starts with v=spf1 and ends with an all rule, for example v=spf1 ip4:203.0.113.10 include:_spf.google.com ~all.

02Can a domain have multiple SPF records, and how do I merge them?

No. Two or more TXT records that start with v=spf1 give a permerror, and mail from the domain fails SPF. To merge them, write v=spf1 once, collect the terms from both records and end with a single all rule: v=spf1 include:_spf.google.com ~all and v=spf1 include:sendgrid.net ~all become v=spf1 include:_spf.google.com include:sendgrid.net ~all.

03What is the difference between ~all and -all?

~all (softfail) asks receivers to accept mail from unlisted servers and mark it as suspicious. -all (hardfail) asks them to reject it. Use ~all while you connect services and read DMARC reports. Switch to -all once you have listed each sender and the reports show no legitimate mail failing.

04Why does SPF fail with too many DNS lookups, and what is SPF flattening?

RFC 7208 caps an SPF check at 10 DNS lookups. Terms inside nested includes count toward the same total, and a receiver that needs an 11th lookup stops with a permerror. To get back under 10, remove services you no longer use, list your own servers with ip4 and ip6 instead of a and mx, and move bulk mail to a subdomain with its own record. SPF flattening replaces includes with the IP ranges behind them. It saves lookups, but a provider can change its ranges at any time, so you need a script that rebuilds the flattened record.

05What does "no SPF record found" mean and how do I fix it?

The checker found no TXT record starting with v=spf1 on the domain you entered. Receivers return the result none, and DMARC can pass only through DKIM. Build a record in the generator above and publish it as a TXT record at the domain root. Resolvers cache the empty answer for up to the negative TTL set in the zone's SOA record, so give it a few minutes before you check again. If the check still finds nothing, look at the host field: when you type example.com there, some DNS panels append the domain and publish the record at example.com.example.com. Use @ instead.

06Does a domain that sends no mail need SPF?

Yes. Publish v=spf1 -all to tell receivers the domain never sends mail, and they can reject forged messages that use it. Add DMARC with p=reject next to it.

07Does SPF check the From address?

No. SPF looks at the envelope domain, the Return-Path. DMARC protects the address the recipient sees: it requires the SPF or DKIM domain to match the domain in the From field.

08How do I add an SPF record at my DNS host?

Tick your mail services in the generator above and add your own IPs. In your DNS panel, create one TXT record with host @ and paste the value. If a v=spf1 record exists, edit it instead of adding a second one. One TXT string holds up to 255 characters, so split a longer record into several quoted strings inside the same TXT record; receivers and this checker join them back together. Then run the SPF check here.

Pricing Grab a free hour