4 / 10 Root Lookups · Pre-Seeded Stack Guide

Google Workspace + Mailgun SPF & DMARC Setup

Combine Google Workspace (3 lookups) with Mailgun (1 lookup) at 4/10 lookups, or isolate Mailgun onto mg.<domain>.

1. Domain, Providers & DMARC Policy

RFC 7208 + RFC 7489
Verified Email Providers (Click to Include in Root SPF)
RFC 7208 DNS Lookup Budget Guard
4 / 10 lookups
HEALTHY
Healthy budget: 4/10 root lookups consumed (6 remaining).
TXT @ example.com (SPF Record)
v=spf1 include:_spf.google.com include:mailgun.org ~all
55 chars (RFC 7208 single TXT string limit: 255 chars; keep total DNS response under 512 bytes)
TXT @ _dmarc.example.com (DMARC Record)
v=DMARC1; p=quarantine; pct=100; adkim=r; aspf=r; rua=mailto:[email protected]
Live DNS Verification ReadyCheck

Verify your live SPF, DMARC, DKIM & MTA-STS

After publishing DNS records, run an instant Cloudflare DoH audit on ReadyCheck or grab the $49 Fix Pack for custom DKIM, MTA-STS, BIMI & AEO deployment.

Stack Provider Breakdown & DKIM Selectors

Provider Root Include Lookups DKIM Selector
Google Workspace include:_spf.google.com 3 google._domainkey
Mailgun include:mailgun.org 1 mx._domainkey / krs._domainkey
Google Workspace Alignment Note: Google signs DKIM with your custom domain when enabled; ensure Return-Path aligns or rely on DKIM alignment for DMARC.
Mailgun Alignment Note: Mailgun recommends delegating transactional mail to mg.<domain> so root SPF remains uncluttered.

Production Rollout Checklist

  • Publish Mailgun's TXT DKIM record on your root domain if sending from @yourdomain.com, or delegate Mailgun entirely to mg.<domain>.
  • When Mailgun sends via mg.<domain>, root SPF does not even need include:mailgun.org unless root addresses also route through Mailgun APIs.
  • Verify both Google Workspace (google._domainkey) and Mailgun DKIM pass before setting DMARC p=reject.
Next Step: Verify your published DNS records live with ReadyCheck (checks SPF, DMARC, DKIM selectors, MX, MTA-STS & BIMI via Cloudflare DoH).

Related Email Stack Guides

← Back to all 15 providers & 24 SPF/DMARC guides

Frequently Asked Questions

How many DNS lookups does Google Workspace + Mailgun consume?

This stack consumes 4 of the 10 permitted RFC 7208 root DNS lookups (6 remaining). All active includes are merged into a single v=spf1 TXT record.

What DMARC alignment settings work best for Google Workspace + Mailgun?

Start with relaxed alignment (adkim=r, aspf=r) and p=quarantine at pct=100 while verifying DKIM keys across Google Workspace and Mailgun.

Should I use ~all or -all on my SPF record?

Most modern mail security teams pair ~all or -all with DMARC p=quarantine/reject. Use ~all during rollout to avoid dropping legitimate forwarded mail, then tighten to -all once rua reports confirm 100% pass rates.