How to Check SPF Records

SPF (Sender Policy Framework) is an email authentication mechanism that lets domain owners publish a list of IP addresses and servers authorized to send email on their behalf. Checking a domain's SPF record is essential when troubleshooting email delivery issues, investigating suspicious messages, or verifying that your own domain's email authentication is correctly configured.

Method 1: Use a web-based DNS lookup tool

The simplest approach is to use IPLookupHub's DNS Lookup tool. Enter the domain name, select TXT as the record type, and look for the record that begins with v=spf1. That is the SPF record.

Method 2: Use dig on the command line

dig example.com TXT

Scan the output for the TXT record starting with v=spf1. A typical result looks like:

example.com.  300  IN  TXT  "v=spf1 include:_spf.google.com ~all"

Method 3: Use nslookup

nslookup -type=TXT example.com

Understanding SPF syntax

An SPF record is a single TXT string that starts with v=spf1 and contains one or more mechanisms:

MechanismWhat it doesExample
ip4Authorizes a specific IPv4 address or rangeip4:192.0.2.0/24
ip6Authorizes a specific IPv6 address or rangeip6:2001:db8::/32
includeReferences another domain's SPF recordinclude:_spf.google.com
aAuthorizes the domain's A record IPa
mxAuthorizes the domain's MX server IPsmx
~allSoft fail: accept but flag unauthorized~all
-allHard fail: reject unauthorized senders-all

Common SPF mistakes

Frequently asked questions

What is an SPF record?

An SPF record is a DNS TXT record that lists the IP addresses and servers authorized to send email on behalf of a domain. Receiving mail servers check SPF to help detect forged senders.

Where is the SPF record stored?

SPF records are stored as TXT records at the domain's root in DNS. There should be only one SPF TXT record per domain.

What does ~all vs -all mean in SPF?

~all (tilde) means soft fail — mail from unauthorized servers is accepted but flagged. -all (dash) means hard fail — unauthorized mail should be rejected. Most modern setups use ~all or -all.

What is the SPF 10-lookup limit?

SPF has a limit of 10 DNS lookups during evaluation. Each include, a, mx, ptr, exists, and redirect mechanism counts as a lookup. Exceeding this limit causes a permanent error (permerror).