SPF Analyzer

SPF Record Checker & Lookup Tool

Verify your domain's SPF record configuration. Identify authorized senders, detect errors, and prevent email spoofing.

SPF Explained

What Is SPF?

Sender Policy Framework (SPF) is an email authentication standard defined in RFC 7208. It allows domain owners to publish a DNS TXT record listing the mail servers authorized to send email on behalf of their domain. When a receiving mail server gets an inbound message, it checks the sender's SPF record to confirm the sending server is legitimate.

SPF works by matching the sending server's IP address against the list of authorized IPs in the domain's SPF record. If the IP is authorized, the message passes SPF. If the IP is not listed, the message fails or softfails depending on the all qualifier at the end of the record. This process helps receivers identify and reject spoofed emails before they reach the inbox.

Publishing an SPF record is one of the foundational steps in email authentication. Together with DKIM and DMARC, SPF protects your domain from impersonation attacks, improves your sender reputation, and increases your email delivery rates across major inbox providers.

Reference

SPF Tag Reference

TagDescription
vSPF version. The only valid value is v=spf1. This tag must appear first in every SPF record.
ip4Authorizes an IPv4 address or CIDR range to send email for your domain. Example: ip4:192.0.2.0/24.
ip6Authorizes an IPv6 address or CIDR range to send email for your domain. Example: ip6:2001:db8::/32.
aAuthorizes the IP address of the domain's A record. You can specify a different domain with a=example.com.
mxAuthorizes the IP addresses of the domain's MX records. Receivers look up the MX records and allow those IPs.
ptrAuthorizes senders whose reverse DNS matches the domain. This mechanism is slow, unreliable, and not recommended.
existsAuthorizes senders if a given domain name resolves to any address. Useful for dynamic allowlists. Example: exists:_spf.example.com.
includeIncludes all authorized senders from another domain's SPF record. Commonly used for third-party services like Google Workspace or Mailchimp.
allMatches every sender not matched earlier. Placed at the end of the record as -all (fail), ~all (softfail), ?all (neutral) or +all (pass, never use).
redirectModifier that hands evaluation to another domain's SPF record when no mechanism matched. It is ignored if the record has an all mechanism. Counts as one DNS lookup.
expModifier that points to a TXT record with an explanation receivers may show when SPF fails.
Best Practices

SPF Best Practices

1

Use the ~all Mechanism

Start with ~all (softfail) instead of -all (hard fail). This lets you monitor failed authentication results without rejecting legitimate email. Switch to -all once you are confident in your configuration.

2

Keep Your SPF Record Under the 10-Lookup Limit

Each include, a, mx, ptr and exists mechanism, and the redirect modifier, triggers a DNS lookup. Lookups inside included records count too. RFC 7208 limits SPF to 10 DNS lookups. Exceeding this limit causes a PermError, which makes your SPF record invalid.

3

Remove Unused include Statements

Audit your SPF record regularly. Remove any include statements for services you no longer use. Every unnecessary include consumes a DNS lookup and increases the risk of exceeding the limit.

4

Avoid the ptr Mechanism

The ptr mechanism depends on reverse DNS, which is slow and unreliable. Most receivers ignore or penalize ptr-based authorization. Use ip4, ip6, or include instead.

5

Do Not Use +all

A +all mechanism authorizes every sender on the internet to send email on behalf of your domain. This defeats the purpose of SPF entirely. Never use +all in a production record.

6

Maintain a Single SPF Record per Domain

Publishing multiple SPF TXT records at the same domain causes a PermError. If you need to add more senders, modify your existing record rather than creating a second one.

Limitations

What Are the Limitations of SPF?

10-DNS-Lookup Limit

RFC 7208 caps SPF evaluation at 10 DNS lookups. Every include, a, mx, ptr, and exists mechanism, and the redirect modifier, triggers a separate lookup. Domains using multiple third-party email services often exceed this limit, which results in a PermError and invalidates the entire SPF record. Receiving servers then treat SPF as failed for your domain.

Email Forwarding Breaks SPF

When an email is forwarded, the receiver sees the forwarding server's IP address, not the original sender's. Since the forwarder's IP is not listed in the original sender's SPF record, the message fails SPF. This is a known limitation of SPF and one reason DMARC also accepts an aligned DKIM pass, which usually survives forwarding.

SPF Alignment Requirements

SPF authenticates the envelope-from address (Return-Path header), not the From header visible to recipients. For SPF to pass DMARC alignment, the envelope-from domain must match the From header domain. If your email is sent through a third-party service that uses its own envelope-from domain, SPF will fail alignment under DMARC unless you configure the service to use your domain in the Return-Path.

FAQ

Frequently Asked Questions

Protect your domain from email spoofing

Monitor your SPF, DKIM, and DMARC records in one place. Start your free trial and secure your email authentication today.

Start Your 14-Day Trial Now