Network & email

SPF Checker

Fetch a domain's SPF record, follow every include and redirect, and count the DNS lookups against the limit of 10. Errors, risky policies and oversized records are flagged. A builder is below.

  • Only domain names are sent, to Cloudflare public DNS (Google if Cloudflare is unreachable). Nothing goes to katlab.
Try:

SPF record builder

Tick the services that send mail for your domain. Add your own server addresses, pick what should happen to everything else, and copy the record. Publish it as a single TXT record on your domain.

One per line, or separated by spaces or commas.

How it works

1

Type the domain that sends your mail, such as example.com.

2

The summary shows DNS lookups out of 10, void lookups out of 2 and the record size. The include tree shows where every lookup comes from.

3

Errors, warnings and advice are listed. To write a new record, tick your senders in the builder below and copy the result.

What SPF does

SPF is a DNS record that lists the servers allowed to send mail for your domain. Receivers compare the connecting server's IP address with that list. A good record ends in -all (reject) or ~all (soft fail) so that servers you did not list do not pass.

The 10-lookup limit

While checking one message, a receiver may run at most 10 DNS-querying terms: include, a, mx, ptr, exists and redirect. Includes count together with everything they include in turn. Go past 10 and the result is a permanent error, which many receivers treat as an SPF failure for every message you send. A second limit allows only 2 void lookups, lookups that return nothing.

The count shown here is the worst case, where every term is evaluated. Real receivers stop at the first match, but the limit has to hold for any sender that falls through, so staying under 10 in this view is the safe target. If you are over, remove services you no longer use, or replace includes with ip4 and ip6 ranges (flattening). Flattened ranges go stale when providers change them, so prefer removing unused senders first.

Other problems found

  • More than one SPF record on a domain (a permanent error)
  • Syntax errors such as an unknown mechanism or a bad IP
  • +all, ?all or no closing all
  • The deprecated ptr mechanism
  • Records over 255 characters in one string or 512 bytes in total

Who sees your lookup?

The domain name you type, plus names derived from it such as _dmarc. or _domainkey. variants, is sent over HTTPS to Cloudflare's public DNS-over-HTTPS resolver (cloudflare-dns.com). If Cloudflare cannot be reached, the same query goes to Google's (dns.google) instead. Nothing else is sent, no cookies and no referrer. Those resolvers see the name and your IP address, as with any DNS lookup, under their own privacy policies. Nothing goes to katlab: there is no server behind this page, no account, no analytics and no saved history.

Questions

Frequently asked questions

What is the SPF 10-lookup limit?

RFC 7208 allows at most 10 DNS-querying mechanisms (include, a, mx, ptr, exists and redirect) while a receiver evaluates one SPF record, counting nested includes. Above 10 the check returns a permanent error.

Do ip4 and ip6 count as lookups?

No. ip4, ip6 and all need no DNS query, so they are free. That is why flattening includes into IP ranges lowers the count.

What are void lookups?

Lookups that return no data or a non-existent domain. RFC 7208 says a receiver should give a permanent error after more than 2 of them, which catches records that point to names that no longer exist.

Should I use ~all or -all?

~all (soft fail) is the common choice while you are still finding every sender, and works well together with a DMARC policy. -all (hard fail) is stricter. Both are far better than ?all or +all.

Why does my record show as split into several strings?

A single DNS TXT string holds up to 255 characters. Longer records are stored as several strings that receivers join. That is valid. Records over about 512 bytes in total can fail on some resolvers.

Why is my domain over 10 although I only include two services?

Each include brings its own nested includes. Large providers such as Microsoft or Google can use several lookups on their own. Open the tree to see the cost of each branch.

Related tools