Skip to content

Google Workspace DNS records on a cPanel zone — the full set

Google Workspace needs MX, SPF, DKIM, plus site verification and a handful of optional CNAMEs. Here is the full set, in the order you need to add them.

A customer signs up for Google Workspace and follows Google’s setup wizard. They paste five records into cPanel’s Zone Editor. Three months later, mail authentication tools report SPF passes but DKIM fails. The five records were the right starter set but missed the DKIM that Workspace silently expected to be enabled separately in the admin console. Setting up Google Workspace DNS on a cPanel zone is straightforward — if you know the full list.

What’s happening

Google Workspace’s DNS-side requirements:

  • MX records for mail flow. Two records, both pointing to smtp.google.com. (formerly the five ASPMX.L.GOOGLE.COM records — Google consolidated to one MX in 2023).
  • TXT for site verification. Google issues a unique google-site-verification=<token> TXT.
  • SPF. Add Google to the SPF record (include:_spf.google.com).
  • DKIM. Generated in the Workspace admin console, published as TXT at google._domainkey.example.com.
  • DMARC. Required for new senders into Gmail’s bulk-sender tier; recommended for everyone else.
  • Optional CNAMEs for branded URLs: mail.example.com → ghs.googlehosted.com, calendar.example.com → ghs.googlehosted.com, etc.

The DKIM step is the one most operators miss. Google doesn’t auto-generate DKIM at signup — you have to enable it in admin.google.com > Apps > Google Workspace > Gmail > Authenticate email, then copy the TXT to DNS.

How to verify

After publishing the records, walk every check:

dig +short MX example.com
dig +short TXT example.com | grep google
dig +short TXT _dmarc.example.com
dig +short TXT google._domainkey.example.com

The MX should be 1 smtp.google.com. (or the legacy ASPMX entries). The site verification TXT is a long random string starting with google-site-verification=. The DKIM TXT is v=DKIM1; k=rsa; p=<base64-key>.

Test mail authentication end-to-end:

swaks --to dummy@gmail.com --from user@example.com --server <google-mx>

Or send a real message and check the Authentication-Results header on the receiving side. Should show:

spf=pass smtp.mailfrom=example.com
dkim=pass header.d=example.com header.s=google

What to do

  1. Add MX in cPanel Zone Editor:
example.com  IN MX 1 smtp.google.com.

(Or, for the legacy multi-MX setup, add five priority levels per Google’s docs.)

  1. Add the site verification TXT that Google provides in the Workspace setup wizard. cPanel’s Zone Editor accepts a TXT at the apex:
example.com  IN TXT "google-site-verification=<token>"
  1. Update the SPF to include Google. If you have an existing SPF, modify it; if not, create:
example.com  IN TXT "v=spf1 include:_spf.google.com ~all"

If you also send through Mailchimp, Mailgun, or another service, add each include: here — but check the SPF lookup limit doesn’t exceed 10.

  1. Enable DKIM in the Workspace admin console.

    • Go to admin.google.com > Apps > Google Workspace > Gmail > Authenticate email.
    • Click “Generate new record”. Default selector is google.
    • Copy the TXT value.
    • In cPanel Zone Editor, add a TXT record at google._domainkey.example.com with the value Google gave you. Watch for the 255-byte segmentation issue — if Google’s UI shows a one-line key, you may need to split it (see the DKIM segmentation article).
    • Back in the admin console, click “Start authentication”.
  2. Add DMARC at _dmarc.example.com:

_dmarc.example.com  IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"

Start with p=none, review reports for a few weeks, then move to p=quarantine and eventually p=reject.

  1. Optional: branded CNAMEs. Add CNAMEs at mail.example.com, calendar.example.com, etc., pointing to ghs.googlehosted.com.. Set these up in the Workspace admin console first, then publish the DNS.

  2. Confirm cPanel’s local mail routing is set to Remote (see the previous article). Otherwise cPanel still tries to deliver locally despite the Workspace MX.

If you’re moving an existing mail flow from cPanel to Workspace, sequence the DNS in this order: SPF first (so authentication works on day one), then DKIM (live as soon as you enable it), then DMARC (start at p=none), then MX last (which switches the actual delivery path).

Stack Harbor handles Google Workspace onboarding including DNS as part of migration solutions.