ToolNestr

SPF Checker

Enter a domain to look up its SPF record, parse all mechanisms and qualifiers, and check the DNS lookup count against the RFC 7208 limit of 10.

Reviewed by the ToolNestr Editorial Team — July 2026

SPF Record Lookup

How SPF works in email delivery

The Sender Policy Framework (SPF) is an email authentication protocol defined in RFC 7208 that helps prevent sender address forgery. When an email is sent, the receiving mail server can check the domain in the envelope sender address (the Return-Path) against the SPF record published in DNS for that domain. If the sending server's IP address is not listed in the SPF record, the email may be rejected or marked as suspicious, depending on the domain's policy.

The SPF record is a specially formatted TXT record that begins with v=spf1. It contains a list of mechanisms that define which servers are authorised to send mail. Each mechanism can optionally include a qualifier that tells the receiving server what action to take if the mechanism matches. The most common mechanisms are ip4: and ip6: which specify authorised IP ranges, include: which references another domain's SPF record, a which matches the domain's A records, and mx which matches the domain's MX records.

The mechanism qualifiers use a single-character prefix. Plus (+) signals Pass — the server is authorised and the email should be accepted. Minus (-) signals Fail — the server is not authorised and the email should be rejected. Tilde (~) signals SoftFail — the server is probably not authorised but the email should be accepted anyway for testing purposes. Question mark (?) signals Neutral — no assertion about authorisation is made. The default qualifier, when none is written explicitly, is Plus (Pass). Most SPF records end with -all (reject all other senders) or ~all (softfail all other senders) as a catch-all mechanism.

Email authentication with SPF has a critical limitation: SPF checks only the envelope sender domain, not the domain shown in the From header that the recipient sees. An attacker can send email from an unauthorised server using a forged envelope sender from a domain that publishes a permissive SPF record, while displaying any domain they want in the From header. This is why SPF is typically combined with DKIM (DomainKeys Identified Mail) and DMARC (Domain-based Message Authentication, Reporting and Conformance) to provide comprehensive email authentication. DMARC aligns the From header domain with the SPF-authenticated domain, closing the gap that SPF alone cannot address.

RFC 7208 mandates that SPF evaluation must not exceed 10 DNS lookups. This limit includes each include: mechanism, each a mechanism (including a: with a domain), and each mx mechanism (including mx: with a domain). Mechanisms like ip4:, ip6:, and exists: do not count toward the limit. The 10-lookup limit exists to prevent denial-of-service attacks using deeply nested SPF records. When the limit is exceeded, the receiving server should return a PermError result, effectively treating the SPF check as failed.

SPF Email Authentication Flow Diagram A diagram showing how a receiving mail server checks the SPF record of the sender's domain to determine whether to accept or reject an email Sending Server IP: 203.0.113.5 1. Email Receiving Server Checks SPF 2. Query DNS DNS Server TXT query for domain 3. SPF record SPF Record Found v=spf1 ip4:203.0.113.0/24 ~all 4. Return 5. IP matches? Result: Pass / SoftFail / Fail / Neutral SPF Result Actions: + Pass ~ SoftFail - Fail ? Neutral RFC 7208 limits SPF evaluation to 10 DNS lookups (include: + a + mx) to prevent abuse
SPF authentication flow showing how a receiving mail server queries DNS for the sender's SPF record and evaluates the result

SPF mechanisms in detail

ip4: and ip6:

These are the most specific mechanisms. ip4:192.0.2.0/24 authorises the entire 192.0.2.0/24 subnet. ip6:2001:db8::/32 authorises an IPv6 range. These do not count toward the DNS lookup limit and are always evaluated first for performance.

include:

The include: mechanism references another domain's SPF record and imports its result. This is how organisations delegate authorisation to third-party email senders like Google Workspace, Mailchimp, or SendGrid. Each include: counts as one DNS lookup.

a and mx

The a mechanism matches the domain's A or AAAA records. a:mail.example.com matches a specific hostname. Similarly, mx matches the domain's MX record targets. Both count as one DNS lookup each.

exists: and redirect=

exists: checks if a given domain has any DNS record at all. redirect= completely replaces the current SPF record with another domain's — no further mechanisms are evaluated after redirect=.

Common SPF mistakes

One of the most frequent errors is exceeding the RFC 7208 limit of 10 DNS lookups. Large organisations that use multiple email service providers often accumulate many include: statements. When the limit is exceeded, receiving servers return a PermError, which may cause legitimate email to be rejected. Another common mistake is publishing an SPF record with +all (pass all) instead of -all or ~all. A +all record essentially says "any server is authorised to send email from this domain," completely defeating the purpose of SPF.

Syntax errors are also common — missing spaces between mechanisms, using a semicolon instead of a space as a separator, or forgetting the v=spf1 prefix. SPF records are also often placed on the wrong subdomain or are split across multiple TXT records when only one TXT record should contain the SPF declaration. If a domain has multiple TXT records starting with v=spf1, the receiving server should return a PermError because the SPF record set is ambiguous.

SPF best practices

Always end your SPF record with -all (hard fail) once you are confident that all authorised senders are listed. During migration or testing, ~all (soft fail) is acceptable. Use ip4: and ip6: mechanisms instead of a or mx whenever possible to reduce DNS lookup count. Monitor your lookup count with this tool and keep it well below 10. Consolidate multiple include: statements if your email senders share a common SPF include. Regularly audit your SPF record to remove stale entries for services you no longer use. Remember that SPF alone is not sufficient for robust email authentication — deploy DKIM signing and a DMARC policy alongside SPF for comprehensive protection against email spoofing and phishing attacks.

References and further reading

Frequently asked questions

What is an SPF record?

An SPF (Sender Policy Framework) record is a TXT record in DNS that lists which mail servers are authorised to send email on behalf of a domain. It helps prevent email spoofing by allowing receiving servers to verify that incoming mail comes from an approved source.

What is the RFC 7208 DNS lookup limit?

RFC 7208 limits SPF records to a maximum of 10 DNS lookups during evaluation. Each include: mechanism, a mechanism, and mx mechanism counts toward this limit. Exceeding 10 results in a permanent error (SoftFail), potentially causing legitimate email to be rejected.

What do the SPF qualifiers mean?

Plus (+) means Pass (accept the email). Minus (-) means Fail (reject the email). Tilde (~) means SoftFail (mark as suspicious but accept). Question mark (?) means Neutral (take no action). The default qualifier when none is specified is + (Pass).

What is the difference between include: and redirect=?

The include: mechanism evaluates the referenced domain's SPF record and contributes its result, but evaluation continues with the remaining mechanisms. The redirect= mechanism replaces the entire SPF record with the referenced domain's record — no other mechanisms are evaluated after redirect=.

Why is my SPF record failing?

Common reasons include: exceeding the 10-lookup limit, typos in IP addresses or domain names, missing or incorrect include: statements for third-party senders (like Google Workspace or Mailchimp), syntax errors, or the record not starting with v=spf1.

How do I set up an SPF record for my domain?

Create a TXT record in your DNS zone with the value starting with v=spf1, followed by mechanisms listing authorised senders. For example: v=spf1 ip4:192.0.2.0/24 include:_spf.google.com ~all. Publish it via your DNS hosting provider's control panel.

All tool categories

Networking & IP Tools (36 tools)
🧮 Everyday (26 tools)
💪 Health & Fitness (30 tools)
💰 Finance (34 tools)
🔢 Math (23 tools)
📄 PDF Tools (10 tools)
🎨 Creators (12 tools)
💻 Developers (24 tools)
⚡ Engineering & Science (24 tools)
⚛️ Physics (48 tools)
🧪 Chemistry (50 tools)
🧬 Biology (50 tools)
🏠 Construction & Home Improvement (105 tools)
👗 Clothing & Garment Tools (68 tools)
🍳 Cooking & Baking (9 tools)
🚗 Automotive (26 tools)
🖼️ Image Tools (13 tools)
🔐 Security & Hash (15 tools)
📝 Text Tools (15 tools)
🔍 SEO Tools (11 tools)
🔄 Converters (69 tools)
🕐 Time & Date (15 tools)
📊 Chart Generators (11 tools)
🕌 Islamic Tools (16 tools)