b2KIT

SPF Record Checker & Builder

Validate SPF records for email authentication. Build new records with include, ip4, ip6, and redirect mechanisms.

Tested tool guide Tested browser tools Checked August 16, 2026

What SPF Record Checker & Builder does, with a checked example

SPF (Sender Policy Framework) tells receiving mail servers which hosts may send mail for your domain, published as a v=spf1 TXT record in DNS. This tool works both ways: enter a domain and it pulls the live record, breaks it into mechanisms, and shows what each authorizes; or build a new record from ip4, ip6, include, and redirect choices and copy out the finished TXT string. The usual surprise: SPF checks the MAIL FROM envelope address, not the From: header you see in the message, and every include, a, mx, or redirect term spends one of a hard 10-DNS-lookup budget.

Worked example

A concrete input and expected output from the current implementation.

Input

ip4:198.51.100.7, include:_spf.example.net, ending qualifier ~all

Expected output

v=spf1 ip4:198.51.100.7 include:_spf.example.net ~all
ip4:198.51.100.7 - matches only mail from that address (0 lookups)
include:_spf.example.net - defers to that domain's record (1 lookup)
~all - softfail for every other sender (0 lookups)
Total: 1 of 10 DNS lookups, syntax valid.

A bare ip4 address counts as a /32, so only mail from 198.51.100.7 matches; the include costs the record's one DNS lookup; ~all softfails everything else. The record reads in first-match order - the specific address first, the delegated provider second, the catch-all last.

How the result is produced

1

Checking a live domain

Enter a domain and the tool fetches its TXT records, isolates the one beginning with v=spf1, and splits it into whitespace-separated terms. It reports what each mechanism authorizes, counts DNS lookups (a, mx, include, exists, ptr, and redirect each cost one), and flags records that exceed the 10-lookup cap, publish more than one v=spf1 record, or end without an all mechanism. Order matters: the first matching mechanism wins.

2

Building a record

Choose mechanisms - ip4 and ip6 ranges, include:domain, or redirect:domain - plus a final all qualifier: ~all softfails unlisted senders, -all rejects them, ?all stays neutral, +all lets everyone through. The builder prepends v=spf1, rejects malformed terms, keeps redirect last (the spec requires it), and totals the DNS lookups the record will consume so you stay under the 10-lookup cap before publishing the single TXT string.

Good uses

  • A new email provider (marketing platform, CRM, or transactional service) asks you to add include:theirdomain to your SPF. Build the updated record, watch the lookup count, and publish one TXT record instead of hand-patching fragments.
  • Your domain's mail lands in spam, or a recipient reports that your mail fails authentication. Check what the domain publishes right now and which senders it actually authorizes, then fix the record instead of guessing.
  • You are taking over a domain - a client migration, an acquisition, a reseller handoff. Inspect the existing record before touching it: what it includes, whether it ends in -all (hard rejection of anything unlisted), and how close the chain sits to the 10-lookup cap.

Limits and checks

  • A pass covers only the envelope sender. SPF checks the MAIL FROM address used during SMTP delivery, not the From: header the reader sees, so a pass does not prove the visible sender is genuine. Legitimately forwarded mail often fails because forwarding rewrites the envelope; read 'pass' as 'this IP was authorized', nothing more.
  • ~all is advice, not a wall. A softfail verdict passes the decision to the receiver, which may accept, quarantine, or reject as it likes - most filters treat softfail as suspicious but deliver anyway. Hard rejection of unlisted senders requires -all, and only after every legitimate sender is covered, or you reject your own mail.
  • Clean syntax is not a clean bill of health. The 10-lookup cap is per evaluation and includes lookups inside included records, so a record whose terms parse fine can still exceed it once include chains resolve - the verdict is permerror, not pass. Two published v=spf1 records do the same: receivers error out rather than combine them.

Common questions

Why does forwarded mail from my domain keep failing SPF at the recipient?

Because forwarding rewrites the envelope sender, the recipient's check runs against the forwarder's domain, not yours, so your record is never consulted. SPF cannot fix this alone - DMARC was designed to compensate by aligning the visible From header with the authenticated domain, and ARC lets forwarders preserve the original results.

I just published my record, but the checker still shows the old one or none at all.

DNS resolvers cache records for the old value's TTL - commonly minutes, sometimes hours - and the checker reads what resolvers currently return, so your change appears only once the cached copy expires. Re-check after the TTL passes, and confirm the record sits at the exact domain used in MAIL FROM: subdomains do not inherit the parent's record.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools