ProductFree toolsLearnPricing AboutContact
Sign in Start free trial

What is SPF?

The list in DNS of the servers allowed to send email for your domain, and why it's only one third of the answer.

Updated:
Nov 2026
Read:
6 min
Level:
Beginner

What SPF does

SPF (Sender Policy Framework) lets a domain owner publish a list of the servers allowed to send email for the domain. When a message arrives, the receiving server checks whether the server that delivered it is on the list.

It answers one narrow question: was this server allowed to send for this domain? It doesn't say whether the message is genuine, wanted or safe.

How a check works

  1. A server connects and announces the envelope sender, the Return-Path address where bounces go, for example bounce@yourcompany.com.
  2. The receiving server looks up the SPF record of that domain, yourcompany.com, in DNS.
  3. It works through the record from left to right, comparing the connecting IP address with each entry.
  4. The first match decides the result. If nothing matches, the all at the end decides.

SPF checks the Return-Path, not the From address. The From address is what people see; the Return-Path is hidden. Many services use their own domain in the Return-Path, so SPF can pass for them while your name is in From. That's the gap DMARC closes. See the four addresses on a message.

Reading an SPF record

Host: @ · Type: TXT
v=spf1 include:spf.protection.outlook.com ip4:203.0.113.10 -all
v=spf1
Marks the record as SPF. It must come first.
include:
Trusts the servers in another domain's SPF record, usually your email platform or a sending service. Microsoft 365 uses include:spf.protection.outlook.com; Google Workspace uses include:_spf.google.com.
ip4: / ip6:
Trusts a specific IP address or range.
a / mx
Trusts the servers in the domain's A or MX records.
-all
Everything else fails (hard fail). ~all means soft fail: suspicious, but not definite. ?all means neutral, no opinion.

SPF results

ResultWhat it means
passThe sending server is on the list.
failIt isn't, and the record ends in -all.
softfailIt isn't, and the record ends in ~all.
neutralThe record ends in ?all and makes no claim.
noneThe domain has no SPF record.
temperrorA temporary DNS problem; a later check may pass.
permerrorThe record is broken: two SPF records, a syntax error or too many DNS lookups.

For DMARC, only pass counts, and only when the domain that passed matches the From address.

Rules and limits

  • One record per domain. Two records starting with v=spf1 cause a permanent error.
  • 10 DNS lookups at most. Every include, a, mx, exists and redirect counts, including the ones nested inside includes. See how to fix too many lookups.
  • No more than two empty lookups. Includes that point at nothing, often for services that shut down, also cause a permanent error.
  • Every sending domain needs its own record, including subdomains. Domains that never send should publish v=spf1 -all.
Check your SPF recordSee every include, count your lookups and find errors in seconds.

Why SPF isn't enough on its own

It doesn't check FromSPF validates the hidden Return-Path, so an attacker can pass SPF for their own domain while putting yours in the From line.
It breaks on forwardingA forwarded message arrives from the forwarding server, which isn't in your record, so SPF fails even for genuine mail.

That's why SPF works as part of a set. DKIM adds a signature that survives forwarding, and DMARC ties both results to the From address people see.

Common questions

#Is SPF required?

In practice, yes. Gmail, Yahoo and Outlook.com expect SPF or DKIM from every sender, and SPF and DKIM from anyone sending in bulk. A domain without SPF is also easier to spoof.

#Where does the SPF record go?

In DNS, as a TXT record at the root of the domain, often entered as @. Each domain and subdomain that sends email needs its own.

#How long does an SPF change take?

Usually minutes to an hour, depending on the record's TTL at your DNS host. Some receivers cache the old record until the TTL runs out.