DMARC 10110 min read · Updated Jun 2026

Every SPF attribute, explained: mechanisms, qualifiers and modifiers

An SPF record is a small grammar of mechanisms, qualifiers and modifiers. Each one changes which servers are authorised, and how receivers treat the rest. Here is what every part actually does.

Anatomy of a record
v=spf1 ip4:198.51.100.0/24 include:_spf.google.com mx a:mail.xmpl.example ~all

Read left to right, a receiver checks each term against the connecting IP and stops at the first match.

The version tag

v=spf1

Mandatory and must be the exact first token. It identifies the TXT record as SPF version 1. A record without it (or with a typo) is ignored entirely, which means no SPF protection at all. Only one valid v=spf1 record may exist per domain. A second produces a PermError.

Mechanisms: who is authorised

Mechanisms are the building blocks that match the connecting server. Note which ones cost a DNS lookup. The total is capped at 10 (see the lookup limit guide).

ip4: / ip6:0 lookups

Authorises a literal IP address or CIDR range. The cheapest, most reliable mechanism: no DNS resolution needed. Use it for static infrastructure you control. ip4:198.51.100.0/24 authorises 256 addresses.

include:1+ lookups

Imports another domain’s SPF record. This is how you authorise third-party senders like include:_spf.google.com. Significance: the included record’s own lookups count towards your limit, so a single include can consume 3–5 lookups. This is the most common cause of hitting the cap.

a1 lookup

Authorises the IP(s) in the domain’s A/AAAA record. Bare a uses the current domain. a:mail.xmpl.example uses a specified host. Significant when your mail server’s IP changes with its DNS record: you avoid hard-coding the address.

mx1 + per host

Authorises every server listed in the domain’s MX records. Convenient when the same hosts both send and receive. But each MX host resolved is an additional lookup, so a domain with several MX entries can be expensive.

ptrdeprecated

Matches based on reverse DNS of the connecting IP. Do not use it. RFC 7208 explicitly discourages it as slow and unreliable, and many receivers ignore it.

exists:1 lookup

Matches if a DNS A lookup of the constructed domain succeeds. Used in advanced macro-based setups (for example per-IP authorisation). Rare outside large ESPs.

all0 lookups

The catch-all that must be last. It matches every IP not matched above, so its qualifier (below) decides the fate of all unlisted senders. The single most important decision in your record.

Qualifiers: what a match means

A prefix on any mechanism sets the result when it matches. The default is + (pass). On all, the qualifier defines your policy for everyone else.

PrefixResultSignificance
+ allPassNever use on all: it authorises the entire internet to send as you.
- allFail (hard)Strictest. Unlisted senders fail outright. The goal once your sender list is complete.
~ allSoftFail"Probably not authorised." The safe default while still discovering senders.
? allNeutralNo opinion: equivalent to no SPF. Rarely useful.

Modifiers

redirect=

Replaces the entire record’s evaluation with that of another domain. Useful to share one canonical SPF policy across many domains. Significance: unlike include:, it is only used if no mechanism matched, and it has no all of its own. The target’s all applies.

exp=

Points to a TXT record containing a human-readable explanation returned on a hard fail. Cosmetic: it does not affect the pass/fail outcome.

The two attributes that matter most

For DMARC, what counts is whether SPF passes and whether the envelope-from domain aligns with the visible From. Your all qualifier governs enforcement. The rest is about listing the right senders without blowing the 10-lookup budget.