ip4 mechanism
The SPF mechanism that matches an IPv4 address or network written directly in the record, such as ip4:192.0.2.0/24, without any DNS lookup.
What it means
ip4 lists a sending address in plain form: ip4:203.0.113.10 for one host, ip4:198.51.100.0/24 for a network. Without a prefix length the mechanism means a single address (/32). Partial addresses are not allowed; a network is written with CIDR notation instead.
Because the address is in the record itself, ip4 needs no DNS query and does not count toward the limit of ten lookups. That is why replacing include, a and mx with explicit addresses (flattening) is one way to bring a record back under the limit. The cost is maintenance: if a provider changes its addresses, a hard-coded list goes stale without warning.
ip4 only ever matches IPv4 connections. Servers that send over IPv6 need an ip6 entry as well.
Example
v=spf1 ip4:203.0.113.10 ip4:198.51.100.0/24 -allRelated terms
On this site
Sources
What this definition rests on. The wording is ours; the facts are theirs.
- RFC 7208: Sender Policy Framework (SPF), section 5.6rfc-editor.org
All 432 terms in the glossaryThe wiki: blocklists and bounce codes