DNS

MX Records and SPF

The SPF mx mechanism authorizes IP addresses of the domain's MX hosts, linking inbound and outbound mail DNS in specific scenarios.

Intermediate · 6 min read · Reviewed Jul 4, 2026

Quick answer

The SPF mx mechanism authorizes IP addresses of the domain MX mail exchangers by performing MX and A or AAAA lookups. It is used when outbound mail sends from the same infrastructure that receives mail for the domain. Cloud-hosted mailbox providers usually require include macros instead of mx alone. The mx mechanism consumes multiple DNS lookups.

Beginner explanation

MX records tell the world where to deliver mail for your domain. The SPF mx mechanism says outbound senders on those same hosts may also send as you. In classic on-premise setups, that coupling made sense.

Modern cloud email often breaks the assumption that MX hosts send employee mail. Microsoft 365 and Google Workspace use includes precisely because their outbound IPs are not simple A records of your MX names.

Knowing when mx is appropriate prevents both lookup waste and false confidence that your MX configuration alone authorizes SaaS senders.

Technical explanation

The mx mechanism triggers an MX lookup on the domain being evaluated, then resolves each MX hostname to A or AAAA records. Those IPs are compared to the connecting client. An mx:subdomain.example.com variant scopes lookups to another domain's MX set.

Each step consumes DNS lookups, so mx is more expensive than static ip4 entries. For Google Workspace, include:_spf.google.com is the supported pattern rather than mx alone.

Some legacy documentation still recommends mx for simple self-hosted Postfix or Exchange edge servers. Validate with actual SMTP egress IPs after any MX migration because receiving and sending paths may diverge in split architectures.

Business impact

Incorrect mx reliance leaves cloud outbound mail unauthorized while DNS appears superficially correct to non-specialists. Migration projects to hosted mailbox providers often stall on this misunderstanding.

Unnecessary mx mechanisms add lookup overhead that can push crowded records into PermError, affecting all mail streams on the domain.

Common mistakes

- Using mx alone for Microsoft 365 or Google Workspace instead of provider includes
- Assuming MX points to the same IPs used by marketing ESPs
- Forgetting that mx lookups count toward the ten-lookup SPF limit

How SPF Manager helps

SPF Manager shows whether mx mechanisms actually cover observed sending IPs or merely mirror obsolete inbound DNS. It recommends provider includes when mx does not match production SMTP paths.

Lookup accounting highlights mx-related DNS cost compared with includes or ip mechanisms.

Recommended next step

See how this applies to your domain before you change DNS.

Analyze my domain

Related articles

SPF Basics

SPF Include Mechanism

The SPF include mechanism authorizes another domain's SPF policy as part of your own, enabling third-party senders without listing every IP.

Beginner 5 min read

DNS

DNS Lookups in SPF

DNS lookups are the queries receivers perform to fetch SPF policies and resolve hostnames to IP addresses during authentication.

Intermediate 6 min read

Microsoft 365

Microsoft 365 SPF Setup

Microsoft 365 requires include:spf.protection.outlook.com in your SPF record to authorize Exchange Online outbound mail.

Beginner 6 min read

Google Workspace

Google Workspace SPF Setup

Google Workspace uses include:_spf.google.com to authorize Gmail and Google Apps SMTP infrastructure for your domain.

Beginner 6 min read