SPF Record Validator

Check an SPF record for syntax errors and count the DNS lookups it costs against the limit of ten.

The TXT value, starting v=spf1. One record per line to check several.

100 runs left today · sign up for more

About this tool

Parses an SPF record, explains each mechanism, and counts the DNS lookups it will cost.

**The lookup limit is the thing that breaks working setups.** Every `include`, `a`, `mx`, `ptr` and `exists` costs one DNS lookup during evaluation, includes nest and bring their own, and the moment the total exceeds ten the receiving server returns permerror. At that point the entire record is treated as absent, and mail that passed yesterday fails today. Adding one more marketing tool to a record already sitting at nine is how it happens, and nothing warns you.

The other common fault is the qualifier at the end. `+all` accepts mail from anywhere and makes the record worse than useless; `?all` neither passes nor fails; `~all` is a soft fail; `-all` is the strict setting most domains should end on.

**This counts the mechanisms in the record you paste.** It does not resolve includes, so it cannot count what they bring — and it says which are unknown rather than guessing.

Common questions

What happens when the ten-lookup limit is exceeded?

The receiving server returns permerror, and most treat that as no SPF record at all. Mail that would have passed starts failing, and the change that caused it was adding one include to a record that already looked fine.

How do I reduce the number of lookups?

Remove services you no longer send from — that is usually most of the excess. Replace an include with the ip4 and ip6 ranges it resolves to, accepting that you now have to maintain them. Flattening tools do this automatically and quietly break when the provider changes IPs.

Should I use ~all or -all?

-all, once you are confident every legitimate sender is listed. ~all is the safer starting point while you check. +all accepts mail from anywhere and is worse than having no record.

Can a domain have two SPF records?

No. Two TXT records starting v=spf1 is a permerror, exactly as though the limit had been exceeded. Merge them into one.