Understanding SPF records and email authentication
An SPF record is a DNS TXT record that specifies which mail servers are authorized to send emails for a domain. SPF records enable email authentication by telling receiving mail servers which IP addresses and servers are allowed to send emails for a domain.
SPF records use mechanisms (ip4, ip6, include, a, mx, all) to specify authorized senders and qualifiers (+, -, ~, ?) to specify how to handle unauthorized senders. SPF records are published as TXT records in DNS and are essential for email authentication and preventing email spoofing.
Check SPF records using our SPF lookup tool to verify email authentication configuration. Learn more about SPF and TXT records.
SPF records follow this format: v=spf1 mechanism1 mechanism2 ... qualifier
v=spf1 ip4:192.0.2.1 include:_spf.google.com -all
All SPF records must start with v=spf1 to identify the SPF version.
SPF records use mechanisms to specify authorized senders (ip4, ip6, include, a, mx, all).
If no qualifier is specified, + (pass) is the default.
SPF mechanisms specify authorized senders:
ip4:192.0.2.1 or ip6:2001:db8::1 - Authorize specific IPv4 or IPv6 addresses or ranges.
include:_spf.google.com - Include SPF records from other domains (commonly used for email service providers).
a or a:example.com - Authorize IPs from domain's A records.
mx or mx:example.com - Authorize IPs from domain's MX records.
all - Match everything else (used with qualifiers to specify default action).
SPF qualifiers specify how to handle senders:
+ip4:192.0.2.1 - Authorize sender (default, can be omitted).
-all - Explicitly reject unauthorized senders.
~all - Mark as suspicious but accept (used for monitoring).
?all - No policy (neither pass nor fail).
Use -all for strict policy, ~all for testing, and avoid ?all.
Use our SPF lookup tool to query SPF records and verify email authentication configuration.
Use command-line tools (dig) to query TXT records: dig TXT example.com
Use our email authentication checker to verify SPF authentication is working correctly.
Verify SPF records are published correctly, syntax is valid, and all authorized mail servers are included.
Test SPF authentication by sending emails and checking SPF results in email headers.