# Google Workspace + Microsoft 365 Dual SPF Setup (M&A Split Delivery Without PermError)

> Configure clean SPF, DKIM, and DMARC during Google Workspace to Microsoft 365 migrations or M&A co-existence while keeping total DNS lookups at 6/10.

- **Canonical URL**: https://opslint.dev/spf/google-workspace-and-microsoft-365-dual-spf-setup/
- **Category**: `SPF`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/spf/#domain=microsoft.com)
- **Normative Specifications**: `RFC 7208 §4.6.4 (Lookup Budget: Google 4 + Microsoft 2 = 6 Lookups)`, `RFC 8617 (ARC Headers on Dual-Delivery / Connector Hops)`

## Incident Symptom & Root Cause

**Production Symptom**: During a corporate merger or phased migration running split delivery between Google Workspace and Microsoft 365 Exchange Online, internal forwarded messages fail SPF at the second tenant's gateway, or adding both providers plus legacy CRM tools pushes total DNS lookups past 10.

**Protocol / Engine Root Cause**: Authorizing both _spf.google.com (4 recursive DNS lookups) and spf.protection.outlook.com (2 DNS lookups, or 1–2 depending on region) consumes 5–6 of your 10 total SPF lookups right out of the gate! Worse, split-delivery mail routed from MX Tenant A (e.g. Microsoft 365) over an SMTP connector to Tenant B (Google Workspace) arrives at Tenant B from Tenant A's outbound relay IPs—failing SPF for external senders' domains unless Tenant B trusts Tenant A as an inbound gateway!

## Remediation Diff (Broken vs Verified Fix)

### Split-Delivery Migration SPF Pushing Over 10 Lookups + Missing Gateway Trust

```text
; 4 (Google) + 2 (M365) + 1 (a) + 1 (mx) + 2 (HubSpot) + 1 (Zendesk) = 11 Lookups -> PermError!
; PLUS inbound external mail routed M365 -> Google fails external sender SPF without Inbound Gateway config!
example.com. 3600 IN TXT "v=spf1 a mx include:_spf.google.com include:spf.protection.outlook.com include:4412345.spf01.hubspotemail.net include:mail.zendesk.com -all"
```

### 6-Lookup Dual-Tenant Apex SPF + Subdomain ESP Offload

```text
; Apex holds ONLY Google Workspace (4) + Microsoft 365 (1-2) = 5-6 total lookups!
; Keep ~all during active split-delivery connector migration paired with 2048-bit DKIM on BOTH tenants!
example.com.               3600 IN TXT   "v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all"

; Both tenants sign DKIM using non-colliding selectors simultaneously!
google._domainkey.example.com.    3600 IN TXT   "v=DKIM1; k=rsa; p=MIIBIjANBgkqhki..."
selector1._domainkey.example.com. 3600 IN CNAME selector1-example-com._domainkey.example.onmicrosoft.com.
selector2._domainkey.example.com. 3600 IN CNAME selector2-example-com._domainkey.example.onmicrosoft.com.

; Offload HubSpot/transactional mail to dedicated Return-Path subdomains!
```

## Engineering Deep Dive

Combining Google Workspace and Microsoft 365 on a single domain requires coordinating BOTH outbound authentication (your mail to external customers) and inbound split-delivery routing (external customers' mail hopping between your two tenants!). For outbound mail, combining include:_spf.google.com and include:spf.protection.outlook.com in a single v=spf1 record uses ~5–6 lookups total—leaving room for at most 2–3 extra lookups before hitting the 10-lookup wall, so move marketing/transactional ESPs onto subdomains BEFORE cutting over.

Set up DKIM signing on BOTH tenants simultaneously before sending a single split-delivery email! Because DKIM selectors live under independent DNS names (google._domainkey.example.com for Google Workspace vs selector1._domainkey.example.com and selector2._domainkey.example.com for Exchange Online), zero conflict exists between Google and Microsoft DKIM keys—every message sent from either platform gets a cryptographically aligned d=example.com signature!

For inbound split delivery (for example MX points to Microsoft 365 first, which routes @example.com Google-pilot users over to Google Workspace), an email from bank@chase.com hits M365 (SPF=Pass), and M365 forwards it to Google from Microsoft's egress IP (which is NOT in chase.com's SPF record!). To stop Google from quarantining forwarded external mail, add Microsoft's outbound connector IP ranges in Google Admin -> Apps -> Google Workspace -> Gmail -> Spam, Phishing and Malware -> Inbound Gateway (and enable Enhanced Filtering for Connectors / ARC trust on the M365 side when routing Google -> M365)!

## Google Workspace + Microsoft 365 Co-Existence Checklist

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **Apex SPF Lookup Budget** (`#dual-lookup-budget`) | _spf.google.com (~4 lookups) + spf.protection.outlook.com (~1–2 lookups) = 5–6/10 lookups. | Delete redundant 'a' and 'mx'; move CRM/marketing tools to Return-Path subdomains. |
| **Simultaneous DKIM Signing** (`#dual-dkim-selectors`) | Google uses 'google' (or custom prefix); M365 uses 'selector1' & 'selector2' CNAMEs. | Enable 2048-bit DKIM in BOTH admin consoles before starting pilot user migration. |
| **External mail forwarded Tenant A -> Tenant B** (`#dual-inbound-connector`) | Fails external sender's SPF on hop #2 unless Tenant B extracts pre-hop IP / trusts ARC. | Configure Gmail 'Inbound Gateway' or Exchange 'Enhanced Filtering for Connectors (SkipListing)'. |
| **Decommissioning legacy tenant post-migration** (`#dual-post-cutover-cleanup`) | Leaving old spf.protection.outlook.com or _spf.google.com wastes 2–4 lookups and widens attack surface. | Remove retired tenant's SPF include and DKIM records 14 days after final mailbox cutover. |

## Frequently Asked Engineering Questions

### Can an attacker using another Microsoft 365 tenant spoof my domain simply because I have include:spf.protection.outlook.com?

Microsoft mitigates cross-tenant spoofing inside Exchange Online outbound relays by checking domain verification ownership on the sending M365 tenant, AND enforcing DKIM + DMARC p=reject ensures any unverified cross-tenant attempt without your private DKIM key fails DMARC!

### Does order matter between include:_spf.google.com and include:spf.protection.outlook.com?

Put whichever tenant currently sends 80%+ of your daily mail volume FIRST so most outbound messages match on the earliest mechanism with fewer live DNS queries.

### What about Microsoft 365 GCC High / DoD government clouds?

US Government GCC High and DoD tenants use different regional endpoints (such as spf.protection.office365.us) rather than commercial spf.protection.outlook.com—check the exact TXT string displayed in your Microsoft 365 Admin Center Domains blade.

## Related Problem-Cluster Guides

- [Fix Multiple SPF TXT Records PermError: How to Merge Two v=spf1 Records Safely](https://opslint.dev/spf/multiple-spf-txt-records-merge-guide/) — Why publishing two separate v=spf1 TXT records on the same hostname triggers immediate RFC 7208 §4.5 PermError, and the exact algorithm to merge them into one.
- [Fix SPF PermError: Too Many DNS Lookups (Exceeding the RFC 7208 10-Lookup Limit)](https://opslint.dev/spf/permerror-too-many-dns-lookups-10-limit/) — Understand which SPF mechanisms count toward RFC 7208 §4.6.4's hard 10-lookup ceiling, why nested vendor includes blow the budget, and how to cut lookups safely.
- [Why Email Forwarding & Mailing Lists Break SPF/DKIM under DMARC p=reject (SRS, DKIM & ARC)](https://opslint.dev/dmarc/mailing-lists-forwarding-arc-spf-breakage/) — Understand how auto-forwarding breaks SPF and how mailing lists break DKIM signatures under DMARC p=reject, plus SRS, relaxed DKIM canonicalization, and RFC 8617 ARC.
- [DKIM 2048-Bit RSA Key Rotation, Selector Naming, and CNAME Vendor Delegation](https://opslint.dev/dmarc/dkim-2048-bit-key-rotation-and-cname-delegation/) — Upgrade weak 1024-bit DKIM keys to 2048-bit RSA without mid-flight verification failures using dual-selector blue/green rotation and vendor CNAME delegation.
