DNS records for Google Workspace

google workspace, gmail, mx, spf, dkim, dmarc, dns · 0 found this helpful

Use this when your mailboxes are at Google Workspace and your domain's DNS is managed at Barbrick. Google's admin console gives you values specific to your account. This article shows the shape of each.

Before you start

  • Your domain should use Barbrick's nameservers. See Use Barbrick's nameservers.
  • Have your Google Admin console open: admin.google.com.
  • Plan to remove the existing MX records for Barbrick mail.

Records for example.ca

Purpose Type Name Value TTL Priority
Verification TXT @ google-site-verification=aB3dE5fG7hJ9kL1mN3pQ5rS7tU9vW1xY3zA5bC7dE9f 3600
Mail delivery MX @ smtp.google.com 3600 1
SPF TXT @ v=spf1 include:_spf.google.com ~all 3600
DKIM TXT google._domainkey v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... 3600
DMARC TXT _dmarc v=DMARC1; p=none; rua=mailto:[email protected] 3600

Google recommends a single MX record, smtp.google.com at priority 1, for new setups. Older setups use five. The verification value, DKIM key, and anything else the Admin console shows are specific to your account, so copy them from Google.

Legacy five-record MX set

If you prefer or need the older set:

Type Name Value Priority
MX @ ASPMX.L.GOOGLE.COM 1
MX @ ALT1.ASPMX.L.GOOGLE.COM 5
MX @ ALT2.ASPMX.L.GOOGLE.COM 5
MX @ ALT3.ASPMX.L.GOOGLE.COM 10
MX @ ALT4.ASPMX.L.GOOGLE.COM 10

Use one set or the other, not both.

Quickest way

The DNS page has a template that does steps 3 to 5 for you.

  1. Open Account → Hosting → your site → DNS.
  2. Under Moving email elsewhere?, find Google Workspace and click Apply, then Apply template.
  3. We replace your MX and SPF records, and set Mail routing to Remote. Mailboxes here stop receiving new mail.
  4. Add the verification TXT record and the DKIM key from the Google Admin console, as in steps 1, 2 and 6 below.

Steps

  1. In the Admin console, add your domain and copy the TXT verification value.
  2. Open Account → Hosting → your site → DNS, and add the TXT record. Return to Google and select Verify.
  3. Remove the old Barbrick MX record (it points to example.ca or mail.example.ca) and add Google's MX record(s).
  4. Open Account → Hosting → your site → Email, open the More tab, find Mail routing, select example.ca, and choose Remote.
  5. Update SPF. A domain can have only one SPF record. If one exists, edit it instead of adding another. See SPF.
  6. In the Admin console, go to Apps → Google Workspace → Gmail → Authenticate email, generate the DKIM key, and copy the TXT value. Add it in the DNS page as google._domainkey. Then choose Start authentication.
  7. Add the DMARC record. See DMARC.

The DKIM value is long. The DNS page splits it automatically. If your provider limits to 255 characters per string, quote it in two parts.

Optional

Type Name Value Use
CNAME mail ghs.googlehosted.com Custom address for Gmail web. Conflicts with Barbrick's mail host. Skip if you still use mail.example.ca for anything else.

Check

dig MX example.ca +short
dig TXT google._domainkey.example.ca +short
1 smtp.google.com.
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A..."

If something goes wrong

  • Google says MX not found. Wait for DNS. Check you removed old MX records.
  • Mail to your website forms fails SPF. If your site sends mail through Barbrick, add the entries from your existing SPF record in Account → Hosting → your site → DNS to Google's SPF record, so one record covers both. See Set up SPF, DKIM, and DMARC.
  • Mail still arrives at Barbrick mailboxes. Mail routing is on Local. Change it to Remote.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.