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.

MXMail

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:

  1. It tries the server with priority 1 first (smtp.google.com)
  2. If that server is unavailable, it tries priority 5 servers
  3. Servers with equal priority receive traffic in a round-robin fashion
  4. 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:

  1. The sending mail server queries DNS for MX records of example.com
  2. DNS returns the list of mail servers with their priorities
  3. The sender connects to the highest-priority (lowest number) server
  4. 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:

  1. Lower the TTL of existing MX records to 300 seconds at least 24-48 hours before migration
  2. Verify domain ownership in the Google Admin console
  3. Update MX records to Google's servers
  4. Monitor email delivery for the first 24-48 hours
  5. 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.com without 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.

Try It — DNS Record Generator

Open full tool