Paste the SPF record into the validator before you add it to DNS, and we check the syntax, mechanisms, IP addresses and number of direct lookups. A valid record starts with v=spf1, has only known mechanisms and ends with all, for example v=spf1 include:spf.protection.outlook.com -all. Every error is shown with an explanation.
Paste the record, for example v=spf1 include:spf.protection.outlook.com -all.
What we check
That the record starts with v=spf1 and ends with all.
Valid IPv4 and IPv6 addresses and prefixes.
Unknown mechanisms, duplicates, +all and ptr.
The length and the number of direct lookups.
How to use the validator
Paste the whole record, with or without quotes.
Press Check the record. The table shows every term, the qualifier and whether the term costs a lookup.
Fix the errors, and check again until the record is valid.
Add the record as a TXT record on the domain itself, and verify it with the SPF checker.
Common mistakes
A wrong start, like v=spf or spf1 without v=.
A wrong prefix, like ip4:203.0.113.0/33.
Mechanisms after all. Everything after all is ignored.
+all, which lets the whole internet send in your name.
ptr, which RFC 7208 advises against because it is slow and unreliable.
Questions and answers
Does the validator count the lookups in include?
Only the direct ones. Use the SPF lookup counter to count the whole tree.
What is the difference between the validator and the SPF checker?
The validator checks the text you paste, before it is in DNS. The SPF checker fetches the record that is actually in DNS for the domain.
How long can the SPF record be?
Each string in a TXT record can have 255 characters, and longer records are split into several strings. Keep the whole record below about 450 characters, so the DNS answer does not get too large.
What is the difference between -all and ~all?
-all says that all other servers should be rejected (fail), while ~all says that they are suspicious (softfail). With DMARC in place both are safe, and ~all is most common.