Skip to content

Glossary

SPF record: who may send mail for a domain

An SPF record (RFC 7208) is a DNS TXT entry listing the servers allowed to send email for a domain. Syntax, qualifiers, limits and common mistakes.

Updated 2026-11-23

An SPF record is a DNS TXT record, defined in RFC 7208, in which a domain lists the servers allowed to send email for it. A receiving server looks up the record of the domain in the envelope sender, compares the connecting IP address with the list and gets a result: pass, fail, softfail, neutral, none, temperror or permerror.

How it works

The record starts with v=spf1 and is followed by mechanisms, each with an optional qualifier.

example.com.  IN  TXT  "v=spf1 ip4:203.0.113.0/24 include:_spf.mailprovider.example -all"
Mechanism Matches
ip4, ip6 An address or a CIDR range
a, mx The addresses of the domain's own A or MX records
include Whatever another domain's SPF record allows
all Everything else, always last
Qualifier Result
+ (default) Pass
- Fail
~ Softfail
? Neutral

Rules that cause trouble:

  • One record per domain. Two SPF TXT records make the check return permerror.
  • Ten lookups maximum across include, a, mx, ptr, exists and redirect. ip4 and ip6 cost nothing.
  • SPF checks the envelope sender. The MAIL FROM of the SMTP session, not the visible From header. Alignment with the visible domain is DMARC's job.
  • Forwarding breaks it. A forwarder sends from its own IP, which is not in your record.

Publish SPF for every domain you send from, and also for domains you never send from, with v=spf1 -all.

Try your own record in the SPF checker. The full picture is in SPF, DKIM and DMARC explained.

Why it matters for validation

A domain with an SPF record is generally one that runs real mail. A domain without one, or without an MX, is often parked, new or abandoned.

The email API reports domain.spf as true when a record is published, false when not and null when not checked. It reports presence, not correctness, and it does not score your own configuration. SPF also feeds the lookup for sender reputation and deliverability: since large mailbox providers expect authenticated bulk mail, a sending domain without SPF has a harder time reaching the inbox.

Use the field as a mild signal, never as a reason to block an address: plenty of valid personal domains have no SPF.

Frequently asked questions

What is an SPF record?
SPF, the Sender Policy Framework, is a DNS TXT record that lists which servers may send email using your domain in the envelope sender. Receivers compare the connecting server's IP address with that list. It is defined in RFC 7208 and is one of the three main email authentication standards with DKIM and DMARC.
How many DNS lookups can an SPF record trigger?
At most ten. RFC 7208 limits the mechanisms that cause a DNS query, such as include, a, mx, ptr and exists. Going over the limit makes the check return a permanent error, and many receivers treat that as a failure. Flatten includes or remove providers you no longer use.
What is the difference between ~all and -all in SPF?
Both close the record. -all is a hard fail: mail from servers not listed should be rejected. ~all is a soft fail: such mail is suspect but usually accepted and marked. Many senders start with ~all and move to -all once they are sure every legitimate source is listed.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time