MX Records for Gmail / Google Workspace
Configure MX records for Gmail and Google Workspace. Copy the correct priority values, mail server hostnames, and zone file entries for Google email routing.
Zone File Entry
example.com. IN MX 1 smtp.google.com. example.com. IN MX 5 smtp2.google.com. example.com. IN MX 5 smtp3.google.com. example.com. IN MX 10 smtp4.google.com.
Detailed Explanation
Google Workspace MX Records
To route email for your domain through Google Workspace (formerly G Suite / Gmail for Business), you need to configure MX records pointing to Google's mail servers with the correct priority values.
Required MX Records
example.com. 3600 IN MX 1 smtp.google.com.
example.com. 3600 IN MX 5 smtp2.google.com.
example.com. 3600 IN MX 5 smtp3.google.com.
example.com. 3600 IN MX 10 smtp4.google.com.
Understanding MX Priority
The number before each mail server hostname is the priority (also called preference). Lower numbers have higher priority. When a sending server attempts to deliver mail:
- It tries the server with priority 1 first (
smtp.google.com) - If that server is unavailable, it tries priority 5 servers
- Servers with equal priority receive traffic in a round-robin fashion
- Priority 10 servers serve as a last resort
This hierarchy ensures mail delivery even if some of Google's servers experience downtime.
How MX Records Work
When someone sends email to user@example.com:
- The sending mail server queries DNS for MX records of
example.com - DNS returns the list of mail servers with their priorities
- The sender connects to the highest-priority (lowest number) server
- That server accepts the message and delivers it to the recipient's inbox
Additional DNS Records for Google
For complete email setup, Google also requires:
- SPF TXT record:
v=spf1 include:_spf.google.com ~all - DKIM TXT record: Generated in the Google Admin console
- DMARC TXT record:
v=DMARC1; p=none; rua=mailto:dmarc@example.com
These authentication records prevent email spoofing and improve deliverability.
Migration Considerations
When switching to Google Workspace from another email provider:
- Lower the TTL of existing MX records to 300 seconds at least 24-48 hours before migration
- Verify domain ownership in the Google Admin console
- Update MX records to Google's servers
- Monitor email delivery for the first 24-48 hours
- Remove old MX records once the transition is confirmed
Common Mistakes
- Wrong priority order: Ensure the primary server has the lowest number
- Missing trailing dot: In BIND format,
smtp.google.comwithout a trailing dot is relative to the zone origin - Conflicting MX records: Remove all old MX records before adding Google's entries to avoid split delivery
Use Case
Configure these MX records when setting up Google Workspace for your domain to route all incoming email through Gmail's infrastructure.