SPF record checker

This SPF record checker reads the SPF record published for any domain, counts its DNS lookups against the limit of 10, and tells you in plain words whether it is valid. Enter a domain to check it now.

Reads public DNS only. Nothing is stored and no email is sent.

Example result

This is a sample. Enter a domain above to see its own record.

needs 13 DNS lookups (limit is 10)

  • Fail

    SPF: needs 13 DNS lookups (limit is 10)

    SPF allows 10 DNS lookups. Past that it returns a permanent error, so SPF fails even for your legitimate mail.

    v=spf1 include:_spf.google.com include:servers.mcsv.net include:sendgrid.net include:spf.protection.outlook.com include:mail.zendesk.com ~all

One record is one of six checks. The full test also reads MX, the other two authentication records, MTA-STS and BIMI.

Run the full test

What does an SPF record checker test?

An SPF record checker looks up the TXT record that starts with v=spf1 on a domain and tests it against the rules in RFC 7208, the SPF standard. SPF (Sender Policy Framework) is a DNS record that lists the servers allowed to send email for a domain.

This tool runs five tests on the record it finds:

What the SPF checker tests
TestPasses whenWhy it matters
Record existsOne TXT record starts with v=spf1With no record, receivers cannot tell your servers from a forger's
Only one recordExactly 1 SPF record is publishedTwo records return a permanent error and SPF fails for all mail
Lookup count10 or fewer DNS lookups, counted through every includeThe 11th lookup returns a permanent error
EndingThe record ends in -all or ~all+all authorizes every server on the internet
SyntaxEvery mechanism is one the standard definesA typing error invalidates the whole record

How do you read an SPF record?

An SPF record is read left to right, and the first mechanism that matches the sending server decides the result. Here is a typical record for a company that sends from Google Workspace and one marketing platform:

v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.25 ~all
The parts of an SPF record
PartMeaningDNS lookups
v=spf1Marks the record as SPF version 10
include:_spf.google.comAlso allow the servers listed in that domain's SPF record1, plus any inside it
ip4:203.0.113.25Allow this one IPv4 address0
a and mxAllow the domain's own A or MX hosts1 each
~allSoft fail everything else: accept it, but treat it as suspect0
-allHard fail everything else0

Why does SPF fail with "too many DNS lookups"?

SPF fails with a permanent error when checking the record needs more than 10 DNS lookups. Section 4.6.4 of RFC 7208 sets that limit so one email cannot make a receiving server run unlimited queries.

The mechanisms include, a, mx, exists, ptr and the redirect modifier each cost one lookup. Lookups inside an included record count too. include:_spf.google.com alone costs 4, because Google's record includes three more.

This is the most common SPF fault we repair. A company adds a CRM, a help desk, a marketing platform and a billing tool, each with its own include, and passes 10 without noticing. Mail keeps sending. SPF quietly stops passing.

The fixes, in the order we try them:

  1. Remove includes for tools you no longer use. Most records carry at least one.
  2. Move a bulk sender to its own subdomain, for example news.example.com, with its own SPF record.
  3. Replace an include with the ip4 ranges it resolves to, only when the provider publishes fixed ranges.

Be careful with "SPF flattening" services that rewrite every include into IP addresses. Providers change their ranges without notice, and a flattened record goes stale the day they do.

Why can SPF pass and email still land in spam?

SPF passing does not mean a message reaches the inbox. SPF checks the hidden envelope sender, called the Return-Path, and not the From address a person sees. A marketing platform can pass SPF for its own bounce domain while your visible From domain is never checked.

That gap is what DMARC closes. DMARC requires the domain that passed SPF or DKIM to match the visible From domain. Run the DMARC checker on the same domain, and the DKIM checker for the signing key. SPF also breaks on forwarding, because the forwarding server is not in your record, which is why DKIM matters as much.

Past authentication, placement depends on sender reputation, complaint rates and list quality. None of those are visible in DNS. Our guide to why emails go to spam walks through all five checks a message faces.

How do you fix an SPF record?

Fix an SPF record by editing the TXT record at your DNS host, never by adding a second one. Follow these steps:

  1. List every service that sends mail as your domain: mailboxes, marketing, CRM, billing, support.
  2. Get each one's SPF include from its documentation.
  3. Write one record starting with v=spf1, the includes, then ~all.
  4. Check the lookup count with this tool before you save it.
  5. Publish it, wait for the DNS TTL to pass, then check again.

If the record needs more than 10 lookups, or mail is still landing in spam after SPF passes, that is the work we do. See what an email deliverability audit covers, or run the full email deliverability test to check MX, SPF, DKIM, DMARC, MTA-STS and BIMI together.