Xerobit

SPF Record Checker: Validate Syntax and Count Lookups

Paste a Sender Policy Framework record into this SPF record checker to validate its syntax, count the DNS lookup-causing mechanisms and flag common mistakes such as +all or strings over 255 characters. The analysis runs entirely in your browser and nothing is uploaded to any server.

Paste the full TXT record value starting with v=spf1

Result

No issues detected.
  • Status
    Valid
  • DNS lookups
    1

    Limit is 10 per RFC 7208. Counts this record only; each include or redirect target adds its own lookups.

  • Length
    36 chars

    Under 255 char limit

  • Includes
    1
  • Warnings
    0
  • Errors
    0

How to use the spf record checker

  1. Paste your full SPF record (the TXT value starting with v=spf1) into the text area.
  2. The SPF record checker validates the syntax immediately as you type or paste.
  3. Review the DNS lookup count to ensure it stays at or below the RFC 7208 limit of 10.
  4. Check the warnings section for issues like +all, duplicate includes or oversized strings.

How SPF syntax validation works

An SPF record must begin with v=spf1 followed by one or more mechanisms or modifiers. Mechanisms include ip4, ip6, a, mx, ptr, exists and include. Each mechanism may carry a qualifier: + (pass, the default), - (fail), ~ (softfail) or ? (neutral). This SPF record checker splits the input on whitespace, verifies the version tag and checks every token against the grammar defined in RFC 7208.

The checker works on the text you paste and does not query DNS. The lookup count covers this record only: every include or redirect target is a separate record with lookups of its own, so a record that shows 4 here can still exceed 10 once the providers' records are resolved. A record is marked Invalid when a term cannot be parsed (for example a bad ip4 address, an include without a domain, an unknown mechanism or more than 10 lookups), because receivers return permerror for those. Pasted quotes around the TXT value are removed first.

Why the 10-lookup limit matters

RFC 7208 section 4.6.4 mandates that evaluation must not require more than 10 DNS lookups. Mechanisms that cause lookups are include, a, mx, ptr, exists and the redirect modifier. The ip4 and ip6 mechanisms do not cause lookups because their values are embedded directly in the record. Exceeding 10 lookups causes receiving servers to return a permerror, which typically results in failed delivery or messages being routed to spam.

MechanismCauses DNS lookup
ip4 / ip6No
aYes
mxYes
includeYes
ptrYes
existsYes
redirectYes

Common SPF mistakes this tool flags

The most dangerous mistake is using +all, which tells receivers that every IP address on the internet is authorized to send mail for your domain. Spammers exploit this instantly. Always use -all (hard fail) or ~all (soft fail). Another frequent error is listing the same include domain twice, which wastes a lookup slot without adding any authorization. Finally, if your record exceeds 255 characters, it must be split into multiple quoted strings within the DNS TXT record; some administrators forget this and cause parsing failures.

Worked example

Consider the record v=spf1 ip4:203.0.113.0/24 include:_spf.google.com mx -all. The parser identifies four tokens after the version tag. The ip4 mechanism requires zero lookups. The include mechanism requires one lookup. The mx mechanism requires one lookup. Total DNS lookups equal 2, well under the limit of 10. The qualifier on all is -, meaning hard fail, which is the recommended setting. No duplicates exist and the total character length is 57, safely under 255.

Integrating SPF with DMARC and DKIM

SPF alone does not protect your domain from spoofing. It only authorizes sending IPs. For complete email authentication, pair it with DKIM signatures and a DMARC policy. You can build a new record with the SPF record generator, then verify alignment using the DMARC record checker and DKIM record checker. Together these three protocols give receiving servers enough information to reject forged messages reliably.

Worked examples

ExampleInputResult
Valid simple recordSPF record: v=spf1 ip4:192.0.2.0/24 include:_spf.example.com ~allStatus: Valid; DNS lookups: 1; Length: 53 chars; Includes: 1; Warnings: 0; Errors: 0
Dangerous +allSPF record: v=spf1 +allStatus: Valid with warnings; DNS lookups: 0; Length: 11 chars; Includes: 0; Warnings: 1; Errors: 0
Too many lookupsSPF record: v=spf1 include:a.com include:b.com include:c.com include:d.com include:e.com include:f.com include:g.com include:h.com include:i.com include:j.com include:k.com ~allStatus: Invalid; DNS lookups: 11; Length: 165 chars; Includes: 11; Warnings: 0; Errors: 1

FAQ

What is an SPF record?

An SPF (Sender Policy Framework) record is a DNS TXT entry that lists the mail servers authorized to send email on behalf of your domain. Receiving servers check it to detect forged sender addresses.

How many DNS lookups are allowed in SPF?

RFC 7208 limits SPF evaluation to 10 DNS lookups. Mechanisms like include, a, mx, ptr and exists each consume one lookup. Exceeding 10 causes a permanent error.

Why is +all dangerous?

The +all mechanism means every IP address passes SPF validation. Attackers can send mail pretending to be from your domain and receivers will accept it. Always use -all or ~all instead.

Does this SPF record checker upload my data?

No. All parsing and validation happens locally in your browser. Your record is never sent to any server.

What is the maximum length of an SPF record?

A single DNS TXT string is limited to 255 characters. Longer records must be split into multiple strings within the same TXT record. The total combined length should stay under 512 bytes to avoid UDP truncation.

Do ip4 and ip6 mechanisms count toward the lookup limit?

No. Because the IP addresses are written directly in the record, no DNS query is needed to evaluate them.