include vs ip4 vs a vs mx: The Four IP-Providing SPF Mechanisms (RFC 7208 section 5) Compared, with a Decision Matrix for Which One to Use

A focused decision-view comparing the four IP-providing SPF mechanisms operators actually pick between when authoring or modifying an SPF record (RFC 7208 section 5): include (§5.2, the right choice for managed providers like Microsoft 365 and Google Workspace), ip4 (§5.6, the right choice for static IPs you own and control), a (§5.3, the right choice for self-hosted servers identified by an A record), and mx (§5.4, the historical "outbound also serves as MX" pattern). Each mechanism is presented with the canonical Definition / Syntax / Lookup cost / When to use / When NOT to use / Common pitfalls structure, plus a side-by-side comparison table, a five-question decision matrix that picks the right mechanism for any sender, three worked deployment examples, and the seven most common mechanism-choice mistakes. For operators authoring their first SPF record, adding a third-party sender, migrating off a provider, hitting the 10-DNS-lookup cap, or migrating from on-prem to cloud — every situation where the question "which mechanism should I use" arises.

This reference is provided in English. SPF is specified in an English-language RFC (RFC 7208 section 5) and the canonical mechanism vocabulary (include, ip4, ip6, a, mx, redirect, exp) does not translate. We keep the body in the source language so technical terms remain consistent with the specification.

TL;DR

The four IP-providing SPF mechanisms operators actually pick between are include, ip4, a, and mx (RFC 7208 section 5). Quick rule:

  • include — managed providers (Microsoft 365, Google Workspace, Mailchimp, SendGrid). Costs 1 DNS lookup at the parent plus the included records lookups. Always the right choice for a SaaS sender that publishes an include statement.
  • ip4 — static IPs you own and control (on-prem Postfix, dedicated MTA). Costs zero lookups. Use for fixed IPs that do not rotate.
  • a — self-hosted mail server identified by an A record under your control. Costs 1 DNS lookup. Use when you publish the A record yourself (a:mail.example.com).
  • mx — historical "outbound also serves as MX" pattern. Costs 1 lookup for the MX query PLUS 1 lookup per MX target. Use only when your inbound MX server is also your outbound sender.

Cumulative DNS-lookup cost matters: the sum of include + a + mx (and per-MX-target) lookups must stay at or under 10 per RFC 7208 section 4.6.4 or the receiver returns permerror. The ip4 and ip6 mechanisms are FREE (zero lookups). The Domain Security Checker surfaces the live lookup count for your record.

1. When the include / ip4 / a / mx decision matters

Operators face this decision in five common scenarios:

  1. Publishing your first SPF record. You need to authorise the sending infrastructure for a domain. Which mechanism reflects what you actually have?
  2. Adding a third-party sender (a new ESP, transactional service, CRM, helpdesk). The provider typically gives you an include: statement to publish — but sometimes a list of IPs to add as ip4. Which is correct?
  3. Migrating off a provider. Removing a stale include: for a vendor you no longer use — and replacing it with the new vendors mechanism.
  4. Hitting the 10-DNS-lookup cap (RFC 7208 §4.6.4 permerror threshold). Replacing an expensive include tree with ip4 entries (SPF flattening) or consolidating multiple senders behind a single provider.
  5. Migrating from an on-prem MTA to a cloud provider. Replacing legacy a or mx entries with the cloud providers include statement.

This page enumerates each mechanism with the canonical Definition / Syntax / Lookup cost / When to use / When NOT to use / Common pitfalls structure, then presents a side-by-side comparison table, a flow-chart decision matrix, three worked deployment examples, and the seven most common mechanism-choice mistakes.

Scope note: this page covers ONLY the four IP-providing mechanisms operators routinely pick between. The other RFC 7208 mechanisms (ip6, exists, all, deprecated ptr), the qualifiers (+ / - / ~ / ?), and the modifiers (redirect=, exp=) are covered in the comprehensive SPF mechanisms explained reference.

2. The four mechanisms at a glance

Side-by-side comparison of the four IP-providing SPF mechanisms (RFC 7208 section 5). Lookup-cost figures are per occurrence in the record; the per-MX-target multiplier applies to mx only.

include / ip4 / a / mx — RFC 7208 section 5 IP-providing mechanisms compared
Mechanism RFC 7208 § DNS lookup cost Auto-tracks provider changes Canonical use case
include §5.2 1 lookup + included records lookups Yes (follows providers SPF record) Managed SaaS providers (Microsoft 365, Google Workspace, Mailchimp, SendGrid)
ip4 §5.6 0 lookups No (frozen at authoring time) Static IPs you own and control (on-prem Postfix, dedicated MTA)
a §5.3 1 lookup Partial (follows the A/AAAA record under your control) Self-hosted mail server with a published A record
mx §5.4 1 lookup + 1 per MX target Partial (follows the MX list, then per-target A/AAAA) Historical "MX = outbound" pattern (single-server self-hosted)

3. The include mechanism (RFC 7208 §5.2)

Definition: The include mechanism delegates SPF evaluation to another domains SPF record. The receiver fetches the included domains TXT record, evaluates it recursively, and treats a pass there as a pass in your record.

Syntax: include:<domain>. The argument is the domain whose SPF record to evaluate (e.g. include:spf.protection.outlook.com for Microsoft 365, include:_spf.google.com for Google Workspace).

Lookup cost: ONE DNS lookup at the parent record, plus whatever lookups the included record requires. include:_spf.google.com expands to 4 lookups total (the parent + 3 netblock sub-records); include:spf.protection.outlook.com expands to 3 lookups total. The cumulative count is governed by the 10-DNS-lookup limit of RFC 7208 section 4.6.4.

When to use: Use include whenever a managed provider gives you an include: statement. This is the right answer for: Microsoft 365 / Exchange Online, Google Workspace / Gmail, Mailchimp (Mandrill), SendGrid, Mailgun, Postmark, Amazon SES, Salesforce Marketing Cloud, HubSpot, Marketo, Zendesk, Intercom, and the vast majority of commercial transactional ESPs.

When NOT to use: Do NOT use include for a static IP you own and control — that is what ip4 is for. Do NOT use include for a self-hosted server identified by an A record — that is what a is for. Do NOT use include for a domain whose SPF record you do not trust (the included domains record can be modified by its owner without notice — only delegate to providers under explicit business relationship).

Common pitfalls: (1) Stale includes for ex-vendors (the include for a CRM you stopped using 18 months ago is still costing 1+ DNS lookups against your 10-lookup budget). (2) Hitting the 10-lookup cap with multi-vendor stacks (Google Workspace + Microsoft 365 hybrid + 3 ESPs = 14+ lookups, triggers permerror). (3) Recursive include loops (rare but trigger permerror; RFC 7208 limits recursion depth). (4) Misspelled provider domains (include:spf.protection.outlock.com NXDOMAIN → permerror).

4. The ip4 mechanism (RFC 7208 §5.6)

Definition: The ip4 mechanism authorises a specific IPv4 address or CIDR range to send mail on behalf of the domain. The receiver compares the connecting MTAs IP to the listed address or range and returns a match if the IP falls within it.

Syntax: ip4:<ip-or-cidr>. The argument is either a single IPv4 address (ip4:198.51.100.42) or a CIDR range (ip4:198.51.100.0/24). The ip4 prefix is mandatory; just listing the address without ip4: is invalid SPF syntax.

Lookup cost: ZERO DNS lookups. The ip4 mechanism is evaluated entirely from the SPF record itself — the receiver does not query DNS for any subsequent record. This makes ip4 the cheapest mechanism in the 10-DNS-lookup budget.

When to use: Use ip4 for static IPs you own and control. Canonical scenarios: on-premises Postfix or Exchange server with a fixed public IP, self-hosted Mailman or Discourse list server, dedicated outbound MTA in your own data centre, bare-metal mail relay with a static IP, a third-party vendor that gives you a dedicated IP but does not publish an SPF record to include. Also appropriate as an SPF FLATTENING tactic when you are over the 10-lookup cap and need to convert an expensive include into the IPs it currently resolves to.

When NOT to use: Do NOT use ip4 for managed providers whose IPs rotate (Microsoft 365, Google Workspace, any SaaS ESP) — hardcoded ip4 lists go stale within weeks and start failing legitimate mail. Do NOT use ip4 when you have more than ~6-8 IPs from a single source — the resulting record becomes unmaintainable. Do NOT use ip4 for dynamic IPs (NAT pools, dynamic VPS allocations, consumer broadband — use a publication mechanism that tracks the address dynamically, or do not send mail from those IPs).

Common pitfalls: (1) Stale entries for IPs you no longer use (the ip4 for a decommissioned server is still authorising that IP range — a security risk if the IP is reassigned). (2) Overlapping CIDR ranges (no syntax error, but indicates sloppy maintenance). (3) Missing CIDR (writing ip4:198.51.100.0 without /24 authorises only the single host address). (4) Authorising ip4:0.0.0.0/0 (DO NOT — authorises every IPv4 address on the internet, defeats SPF entirely). (5) Forgetting IPv6 (if you have IPv6 senders, you also need ip6: entries — ip4 does NOT cover IPv6 traffic).

5. The a mechanism (RFC 7208 §5.3)

Definition: The a mechanism authorises every IPv4 and IPv6 address published as an A or AAAA record for a hostname. The receiver queries DNS for the hostnames A and AAAA records and treats the connecting IP as authorised if it appears in either response.

Syntax: Three forms: (a) a alone — authorises the A/AAAA records of the SPF records own domain (the domain the receiver is currently evaluating). (b) a:<hostname> — authorises the A/AAAA records of a specific hostname (a:mail.example.com). (c) a/<CIDR> or a:<hostname>/<CIDR> — authorises the CIDR range derived from the A/AAAA records.

Lookup cost: ONE DNS lookup per a mechanism occurrence (counted toward the RFC 7208 §4.6.4 10-lookup limit). The receiver queries one hostname and gets back the A and AAAA records in a single combined response — but the accounting still charges one lookup per a in your record.

When to use: Use a when the sending IP is identified by an A or AAAA record under your DNS control. Canonical scenarios: self-hosted Postfix where a:mail.example.com points at the mail server, an MTA cluster where each node has an A record and you list them as a:node1.example.com a:node2.example.com, a hosting provider that gives you a hostname (not an IP) to use. Also appropriate when the IP changes occasionally and you want SPF to track the change via A-record updates rather than manual SPF record edits.

When NOT to use: Do NOT use a for a managed provider (Microsoft 365, Google Workspace) — their outbound IPs are not published under YOUR A records. Do NOT use a if the hostname has many A records (each IP authorised; if the hostname is a load-balanced cluster with 20 backends, all 20 are authorised — fine if intentional, dangerous if not). Do NOT use bare a (no hostname) unless you want to authorise the A record of the SPF records own domain — this is rarely the right semantic for an enterprise deployment.

Common pitfalls: (1) Bare a when your domains apex A record points at a website (not a mail server) — authorises the web server IP for sending mail. (2) Authorising a hostname you do not control (a:somethirdparty.example — the third party can change their A record and silently change your authorised sender set). (3) Confusing a (A-record-based) with aaaa — there is no aaaa mechanism; a covers both A and AAAA records automatically.

6. The mx mechanism (RFC 7208 §5.4)

Definition: The mx mechanism authorises every IP address published as an MX records target hostname. The receiver queries the MX records, then resolves each MX-target hostname to its A/AAAA records, and treats the connecting IP as authorised if it appears in any of those responses.

Syntax: Three forms: (a) mx alone — uses the MX records of the SPF records own domain. (b) mx:<domain> — uses the MX records of a specific domain. (c) mx/CIDR or mx:<domain>/CIDR — restricts to a CIDR-derived range of each MX targets A/AAAA records.

Lookup cost: ONE DNS lookup for the MX query, PLUS one DNS lookup per MX target hostname resolution. A domain with five MX hosts behind one mx mechanism costs 1 + 5 = 6 lookups against the RFC 7208 §4.6.4 cap. This is the most expensive mechanism — be careful with multi-MX deployments.

When to use: Use mx only when your inbound MX server is ALSO your outbound mail server. This was the canonical 1990s/2000s pattern for self-hosted Postfix or Sendmail deployments where one box handled both directions. Still appropriate for small single-server self-hosted deployments — but rare in modern architectures.

When NOT to use: Do NOT use mx for cloud providers — Microsoft 365 inbound MX (your-tenant.mail.protection.outlook.com) is on a separate IP set from outbound sending (*.outbound.protection.outlook.com); mx would authorise the WRONG IPs. Do NOT use mx when your inbound MX is a spam-filtering gateway (Proofpoint, Mimecast, Barracuda) that terminates inbound mail but does not originate outbound. Do NOT use mx when your inbound/outbound architectures are split (an on-prem Exchange + a separate SendGrid for transactional — the MX and the senders share no IPs).

Common pitfalls: (1) Using mx for cloud-hosted mail (authorises the inbound spam filter, not the outbound sender — every legitimate outbound message fails SPF). (2) Hitting the 10-lookup cap with multi-MX deployments (5 MX hosts + 4 other lookups = 11). (3) Authorising a third-party MX target you do not control (mx:partner.example — the partner can change their MX list and silently expand your authorised sender set). (4) Using mx when a single a:mail.example.com would suffice and cost half as many lookups.

7. The decision matrix

Five questions, in order, to pick the right mechanism for a sender you are about to authorise:

  1. Does the provider give you an include: statement to publish? → Use include. This is the canonical answer for managed SaaS providers (Microsoft 365, Google Workspace, Mailchimp, SendGrid, etc.) and the only choice that auto-tracks the providers IP changes.
  2. Do you own and control a static IP that does not rotate? → Use ip4 (or ip6 for IPv6). Zero DNS lookups, cleanest semantic when you know the IP and the IP will not change.
  3. Does the sender have an A or AAAA record you publish under your zone? → Use a:<hostname>. Tracks A-record updates automatically, one lookup cost.
  4. Is the sending server ALSO your inbound MX server? → Use mx (only if questions 1-3 said no). Modern architectures rarely satisfy this condition; if you find yourself reaching for mx, double-check that your inbound MX and outbound sender genuinely share the same IPs.
  5. None of the above? → You probably should not be authorising this sender. Verify the operational story (a sender without a static IP, without an include statement, without an A record, and not co-located with your MX is unusual and worth investigating before adding to SPF).

Cumulative-cost guardrail: after choosing the mechanism, sum the DNS-lookup cost against your 10-lookup budget. If your record would exceed 10, either consolidate senders (e.g. route transactional mail through Microsoft 365 instead of a separate ESP), flatten an expensive include to its constituent ip4 entries (with a maintenance cadence to refresh), or use the SPF lookup limit and flattening guide for the full playbook.

8. Three worked deployment examples

8.1 Single on-prem Postfix server

Scenario: a small business runs a single Postfix server on a static public IP (198.51.100.42). The server handles both inbound and outbound mail. No third-party senders.

example.com.  IN  TXT  "v=spf1 ip4:198.51.100.42 -all"

Rationale: ip4 is the cheapest mechanism (zero lookups) and the IP is static + owned. No mx or a needed — listing the IP directly is cleaner than indirecting through DNS records. Alternative valid syntax: v=spf1 a:mail.example.com -all (one lookup cost, automatically tracks the A record).

8.2 Microsoft 365 + Mailchimp transactional

Scenario: company uses Microsoft 365 for corporate mail and Mailchimp (Mandrill) for transactional sends. No on-prem MTA.

example.com.  IN  TXT  "v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all"

Rationale: both providers are managed SaaS that publish their own SPF records and rotate IPs — use include. Cumulative lookup cost: 3 (Microsoft 365 expansion tree) + 1 (Mailchimp single record) = 4 lookups, well under the 10-lookup cap. Do NOT use mx (would authorise the M365 inbound spam filter, not the outbound sender). Do NOT hardcode IPs (Microsoft and Mailchimp rotate their outbound IP ranges; an ip4 list would break within weeks).

8.3 Hybrid deployment: Google Workspace + on-prem mailing-list server + SendGrid

Scenario: company uses Google Workspace for corporate mail, a self-hosted Mailman list server on a fixed IP (203.0.113.7), and SendGrid for marketing campaigns.

example.com.  IN  TXT  "v=spf1 include:_spf.google.com ip4:203.0.113.7 include:sendgrid.net -all"

Rationale: Google Workspace and SendGrid are managed providers (use include); the Mailman server is on a static IP under your control (use ip4 — zero lookup cost, no need for an a-record indirection). Cumulative lookup cost: 4 (Google Workspace expansion tree) + 0 (ip4) + 1 (SendGrid) = 5 lookups, half the 10-lookup budget.

9. The seven most common mechanism-choice mistakes

  1. Using mx for cloud-hosted mail (Microsoft 365, Google Workspace). Cloud-mail inbound MX is the providers spam-filtering frontend, NOT the outbound sender — mx authorises the wrong IPs and every legitimate outbound message fails SPF. Fix: replace mx with include:spf.protection.outlook.com (M365) or include:_spf.google.com (Workspace).
  2. Hardcoding cloud-provider IPs with ip4. Microsoft 365 and Google Workspace rotate their outbound IP ranges regularly; a hardcoded ip4 list goes stale within weeks and starts failing legitimate mail. Fix: replace ip4 blocks with the providers include: statement.
  3. Stale include for ex-vendors. The include statement for a CRM you stopped using 18 months ago is still costing 1+ DNS lookups against your 10-lookup budget — and still authorising the ex-vendors infrastructure to send mail as your domain. Fix: audit your SPF record quarterly; remove any include for a vendor you no longer use.
  4. Bare a on a domain whose apex points at a website. v=spf1 a -all on example.com whose apex A record points at the web server authorises the WEB server IP to send mail — almost never the intended semantic. Fix: use a:mail.example.com (the mail-specific hostname) or switch to ip4 / include.
  5. Hitting the 10-DNS-lookup cap by stacking include statements. Google Workspace (4) + Microsoft 365 hybrid (3) + 3 third-party ESPs (3-5) = 10+ lookups, triggers permerror, every mail fails SPF. Fix: consolidate senders (route transactional through your primary mail provider), flatten one expensive include into its current IPs as ip4 entries, or use SPF flattening services with a refresh cadence.
  6. Authorising ip4:0.0.0.0/0. Almost always a typo or copy-paste error — this authorises every IPv4 address on the internet and defeats SPF entirely. Fix: remove immediately; SPF offers no protection while this is in the record.
  7. Forgetting IPv6 coverage. If your senders also publish AAAA records or your providers send over IPv6, an ip4-only record leaves IPv6 traffic unauthenticated. The a, mx, and include mechanisms cover both automatically; bare ip4 does not. Fix: add corresponding ip6: entries or switch to an IPv6-aware mechanism.

10. FAQ

What is the difference between SPF include and ip4?
The SPF include mechanism (RFC 7208 section 5.2) delegates evaluation to another domains SPF record — the receiver fetches the other domains TXT record, evaluates it, and treats a match there as a match in your record. The ip4 mechanism (RFC 7208 section 5.6) authorises a specific IPv4 address or CIDR range directly in your record without any DNS lookup. The two key differences: (1) include costs one DNS lookup at evaluation (counted against the 10-lookup cap of RFC 7208 section 4.6.4), plus the included records own lookups; ip4 costs zero lookups. (2) include automatically reflects the included providers infrastructure changes (when Microsoft 365 adds new outbound IPs to spf.protection.outlook.com, your record stays valid without edits); ip4 freezes the IP list at authoring time and requires manual updates when your providers IPs change. Pick include when delegating to a managed provider (Microsoft 365, Google Workspace, Mailchimp, SendGrid); pick ip4 when authorising static IPs you own and control (on-prem mail server with a known public IP).
What is the difference between SPF a and mx mechanisms?
The SPF a mechanism (RFC 7208 section 5.3) authorises every IPv4 and IPv6 address published as an A or AAAA record for a hostname. The mx mechanism (RFC 7208 section 5.4) authorises every IP address published as an MX records target hostname (after the MX-to-A/AAAA resolution). Key distinction: a points at hostnames you publish directly (a:mail.example.com authorises whatever IPs mail.example.com resolves to); mx points at the MX-list and follows it (mx with no argument means "the MX hosts of THIS domain"; mx:example.com means "the MX hosts of example.com"). Lookup cost: a costs one DNS lookup; mx costs one lookup for the MX query PLUS one lookup per MX target (so a domain with five MX hosts behind one mx mechanism costs six lookups against the 10-lookup cap). Use a for a single-server deployment where the outbound mail server publishes its own A record. Use mx for the historical "my MX server is also my outbound mail server" pattern — but be aware that modern best practice separates inbound MX from outbound sending IPs, in which case ip4 or include is the better choice.
Which SPF mechanism should I use for Microsoft 365?
Use include — specifically include:spf.protection.outlook.com — for Microsoft 365 (Exchange Online) outbound mail. The canonical first-party SPF record for a tenant is v=spf1 include:spf.protection.outlook.com -all. This delegates evaluation to Microsofts managed SPF record, which Microsoft updates as their outbound IP ranges change. Do NOT hardcode Microsoft 365 IPs with ip4 — Microsofts outbound IP set rotates and adds new ranges; a hardcoded ip4 list goes stale within weeks and starts failing legitimate mail. Do NOT use a or mx for Microsoft 365 — Microsofts inbound MX (your-tenant.mail.protection.outlook.com) is separate from their outbound sending infrastructure, and a or mx mechanisms would not authorise the right IPs. If you have additional third-party senders (Mailchimp, SendGrid, Salesforce, HubSpot), append additional include statements: v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net include:sendgrid.net -all. Each include costs one DNS lookup against the 10-lookup cap — monitor the cumulative count with the DMARC Analyzer Domain Security Checker.
Which SPF mechanism should I use for Google Workspace?
Use include — specifically include:_spf.google.com — for Google Workspace outbound mail. The canonical first-party SPF record is v=spf1 include:_spf.google.com -all. Google publishes a 3-level expansion tree (_spf.google.com includes _netblocks.google.com / _netblocks2.google.com / _netblocks3.google.com), which consumes 4 DNS lookups total — track this against the 10-lookup cap. Do NOT hardcode Googles outbound IPs — Google rotates and expands the netblocks; a hardcoded ip4 list goes stale and breaks delivery. Do NOT use a or mx — Googles inbound MX (aspmx.l.google.com etc.) is separate from outbound sending infrastructure. For additional third-party senders, append additional include statements: v=spf1 include:_spf.google.com include:mail.zendesk.com include:_spf.salesforce.com -all. Note that Google Workspace + multi-vendor deployments commonly hit the 10-lookup cap; SPF flattening or careful sender consolidation may be required (see help_spf_lookup_limit.php).
When should I use ip4 instead of include in my SPF record?
Use ip4 when you own and control the sending IP, the IP is static, and you want zero DNS-lookup cost. Canonical scenarios: (1) on-premises Postfix or Exchange server with a known public IP, (2) self-hosted Mailman or Discourse list server, (3) dedicated outbound MTA in your own data centre, (4) bare-metal mail relay with a fixed public IP, (5) self-hosted DKIM-signing mail gateway. The ip4 mechanism is also the right answer when you need to AUTHORISE a sender that does not publish a public SPF record — for example, a third-party transactional vendor that gives you a static dedicated IP but does not publish include-able SPF records. Avoid ip4 for managed providers (Microsoft 365, Google Workspace, any SaaS ESP) — their IPs rotate and ip4 lists go stale. Avoid ip4 when you have more than ~6-8 IPs from one source — the resulting record becomes unmaintainable; use include or a-record indirection instead.
Does the SPF a mechanism count against the 10-DNS-lookup limit?
Yes. The SPF a mechanism (RFC 7208 section 5.3) costs ONE DNS lookup per occurrence in the record, counted against the 10-DNS-lookup limit defined in RFC 7208 section 4.6.4. Each a mechanism in your record (whether a, a:hostname, a/CIDR, or a:hostname/CIDR) consumes one slot. The mx mechanism by contrast costs one lookup for the MX query PLUS additional lookups per MX target (each MX hostname must be resolved to an IP, and each resolution counts). The include and exists mechanisms also cost one lookup each. The ptr mechanism (deprecated, do not use) costs one lookup. The redirect= modifier also costs one lookup. The ip4, ip6, and all mechanisms and the exp= modifier cost ZERO lookups. Cumulative accounting matters: a record using v=spf1 include:_spf.google.com (4) include:spf.protection.outlook.com (3) a (1) mx (typically 2-3) -all reaches 10-11 lookups and triggers permerror. The DMARC Analyzer Domain Security Checker shows the cumulative lookup count for your record.
Can I mix include ip4 a and mx in the same SPF record?
Yes — combining all four mechanism types in one record is permitted by RFC 7208 and is common in production. A typical hybrid record looks like v=spf1 ip4:198.51.100.42 ip4:198.51.100.43 include:spf.protection.outlook.com include:servers.mcsv.net a:mail.example.com mx -all. The receiver evaluates each mechanism left-to-right and returns the first match (per RFC 7208 section 4.6.2 first-match-wins semantics). Combining is the right pattern when your sending stack mixes: (a) static IPs you own (ip4), (b) managed providers (include), (c) a self-hosted server identified by A record (a), and (d) the historical "outbound also serves as MX" deployment (mx). The constraint is cumulative DNS-lookup cost: every include / a / mx (and per-MX-target) costs one lookup against the 10-lookup cap. Order mechanisms by cost (cheapest first, ip4 before include) only for readability — the receivers behaviour is determined by first-match-wins, not by cost.
Why is SPF mx considered legacy?
The mx mechanism reflects a 1990s-era assumption that a domains inbound MX server and its outbound sending server were the same machine — and that authorising the MX hosts was therefore a useful proxy for authorising the senders. That assumption no longer holds for most modern deployments: (1) cloud mail providers (Microsoft 365 inbound MX is your-tenant.mail.protection.outlook.com but outbound goes through *.outbound.protection.outlook.com — different IPs entirely), (2) split inbound/outbound architectures (an on-prem Exchange + a separate SendGrid for transactional means the MX has no overlap with outbound senders), (3) MX-as-spam-filter deployments (Proofpoint, Mimecast, Barracuda terminate inbound mail but do not originate outbound mail). For modern deployments, ip4 (for self-managed static IPs) or include (for managed providers) is the right choice. The mx mechanism still has a valid use case: small single-server self-hosted Postfix where the same box handles inbound and outbound — but that is increasingly rare. The mx mechanism is NOT deprecated in RFC 7208 (only ptr is); it is simply a poor fit for most contemporary architectures.
How do I decide between SPF include and a record?
Use include when delegating to a managed provider that publishes its own SPF record (Microsoft 365, Google Workspace, Mailchimp, SendGrid, Mailgun, Postmark, Amazon SES, Salesforce). The include mechanism follows the providers SPF record at every evaluation, automatically reflecting their infrastructure changes. Use a when the sending IP is identified by an A or AAAA record under YOUR control — typically a self-hosted Postfix/Exchange/Exim server where you publish an A record like a:mail.example.com. Quick decision: (1) Is this a third-party SaaS that gives you an include statement to publish? → include. (2) Is this a server you own where you publish the A record? → a. (3) Is this a static IP you own without a corresponding A record? → ip4. (4) Is this the historical "my inbound MX is also my outbound server" pattern? → mx (but consider migrating to a or ip4 for clearer intent). The DMARC Analyzer DNS Record Generator wizard guides this decision interactively.

12. Audit your SPF record now

The fastest way to confirm your SPF record uses the right mechanism for each sender:

  1. Enumerate your senders. List every system that originates mail as your domain (Microsoft 365 / Google Workspace, ESPs, helpdesks, CRMs, on-prem MTAs, monitoring systems).
  2. For each sender, apply the decision matrix from section 7 to pick the right mechanism.
  3. Use the Domain Security Checker to surface your current SPF record, the cumulative DNS-lookup cost, and any permerror conditions.
  4. Inspect a real outbound message with the Email Header Analyzer to confirm the Authentication-Results header reports spf=pass for legitimate senders.