Google Workspace + Cloudflare
Set up Google Workspace email on Cloudflare
The records Google Workspace needs, written with the field names Cloudflare uses (Name, Mail server, Content, Target), in the order to add them.
- 5 steps
- 5 DNS records
Before you start
- Have your Google Workspace account ready. Some values are unique to your account and come from the Google Admin console .
- Open DNS at Cloudflare: Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page.
- Keep both tabs open and add the records below one at a time.
Google Workspace on Cloudflare: what to know
How long changes take
Cloudflare says Google typically verifies within a few minutes, though DNS propagation can take up to 48 hours.
Cloudflare says changes to your DNS records take effect worldwide within 5 minutes, usually much less. A record you replaced can stay cached until its old TTL runs out.
Source: Set up Google Workspace DNS records (Cloudflare Docs), FAQ (Cloudflare DNS Docs)
Records to add
Copy each value with the button next to it. Rows marked “Copy from Google Admin console” are unique to your account.
| Record | Type | Name | Value | Priority | TTL | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Domain verification Proves you own the domain | Type | TXT | Name | @ | Value | Copy from Google Admin console Looks like: google-site-verification= followed by your unique code | Priority | n/a | TTL | Auto |
| MX records Where incoming email goes | Type | MX | Name | @ | Value | smtp.google.com | Priority | 1 | TTL | Auto |
| SPF record Which servers may send as you | Type | TXT | Name | @ | Value | v=spf1 include:_spf.google.com ~all | Priority | n/a | TTL | Auto |
| DKIM A signature on every message | Type | TXT | Name | google._domainkey | Value | Copy from Google Admin console | Priority | n/a | TTL | Auto |
| DMARC record What to do with fakes · recommended | Type | TXT | Name | _dmarc | Value | v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com | Priority | n/a | TTL | Auto |
Step by step in Cloudflare
Verify your domain
Your email provider needs proof that you control this domain before it accepts email for it.
- Type
- TXT
- Name
-
@ - Content
- Copy it from Google Admin console (see below)
Where to find your value
In the Google Admin console go to Menu > Account > Domains > Manage domains, click Verify domain, then Get started. In the TXT record section, copy the Value, including google-site-verification=.
It looks like: google-site-verification= followed by your unique code
- Leave the host blank or enter @.
- Once Google has verified the domain, this TXT record can be safely removed. Removing it earlier makes verification fail.
1 more note from Google Workspace on this record
In Cloudflare
- On the DNS Records page, select Add record.
- Choose TXT as the Type.
- Fill in Name and Content.
- Select Save.
Point your MX records
MX records tell other mail servers where to deliver your email. How MX works
- Type
- MX
- Name
-
@ - Priority
- 1
- Mail server
-
smtp.google.com
- Remove any other MX records. Email might not work correctly if old or incorrect MX records stay in place.
3 more notes from Google Workspace on this record
In Cloudflare
- On the DNS Records page, select Add record.
- Choose MX as the Type.
- Fill in Name, Mail server and Priority.
- Select Save.
- Delete any other MX records: select Edit on each one, then Delete, and confirm.
Add the SPF record
SPF lists the services allowed to send email as you. How SPF works
- Type
- TXT
- Name
-
@ - Content
-
v=spf1 include:_spf.google.com ~all
- If other services also send email for your domain, list each one in the same record, for example: v=spf1 include:_spf.google.com include:amazonses.com ~all.
2 more notes from Google Workspace on this record
In Cloudflare
- On the DNS Records page, select Add record.
- Choose TXT as the Type.
- Fill in Name and Content.
- Select Save.
Set up DKIM
DKIM signs your mail so receivers can trust it. How DKIM works
- Type
- TXT
- Name
-
google._domainkey - Content
- Copy it from Google Admin console (see below)
Where to find your value
In the Google Admin console go to Menu > Apps > Google Workspace > Gmail and click Authenticate email. Select your domain, generate a new record (2048-bit if your domain host supports it, otherwise 1024-bit) and copy the TXT record value.
- After the record is published, go back to Authenticate email and turn on authentication for the domain.
3 more notes from Google Workspace on this record
In Cloudflare
- On the DNS Records page, select Add record.
- Choose TXT as the Type.
- Fill in Name and Content.
- Select Save.
Add the DMARC record (recommended)
DMARC tells receivers what to do with mail that fakes your domain. How DMARC works
- Type
- TXT
- Name
-
_dmarc - Content
-
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
- Start with p=none so nothing is blocked while you read the reports. Google suggests running it for about a week.
3 more notes from Google Workspace on this record
In Cloudflare
- On the DNS Records page, select Add record.
- Choose TXT as the Type.
- Fill in Name and Content.
- Select Save.
Check your setup
Once the records are saved, run a live check. We look up your domain in public DNS and tell you what is right, missing or wrong, with the fix in Cloudflare’s words.
Common mistakes with Google Workspace on Cloudflare
Leaving old MX records in place
Google says email might not work correctly if old or incorrect MX records stay. Remove every MX record except smtp.google.com.
Adding a second SPF record
A domain must have only one SPF record. If you already have one, add include:_spf.google.com to it instead of creating another.
Cloudflare: Turn off Cloudflare Email Routing first
If Email Routing is on, Cloudflare has added locked MX records (route1, route2 and route3.mx.cloudflare.net) and an SPF record with include:_spf.mx.cloudflare.net. Unlock them or disable Email Routing (Compute > Email Service > Email Routing > your domain > Settings) before switching to another provider. Email Routing can't be used with an outside mail server.
Google Workspace on Cloudflare: questions
I use Cloudflare Email Routing. Can I add Google’s MX record next to it?
No. Cloudflare says Email Routing and Google Workspace MX records can’t coexist on the same domain, so turn Email Routing off before you add Google’s MX record. Turning it off also removes the MX, SPF and DKIM records it added.
Google says “Domain already in use”. Is that a Cloudflare problem?
No. Cloudflare says this message comes from Google’s side, not from your Cloudflare DNS records.
I have several domains on Cloudflare. Do I add everything by hand each time?
Cloudflare suggests exporting the records from DNS > Records and importing them on the other domains. Generate a separate DKIM key for each domain, because DKIM values are unique per domain.
Where do I add Google Workspace DNS records in Cloudflare?
Sign in to the Cloudflare dashboard and select your domain. Open the DNS Records page. Add each record there, one at a time.
What goes in the Name field at Cloudflare?
Enter @ for records on your bare domain, such as MX and SPF. For the others, enter only the part before your domain, for example google._domainkey. Cloudflare adds your domain automatically.
Do I need to delete my existing MX records at Cloudflare?
Remove any other MX records. Email might not work correctly if old or incorrect MX records stay in place. If Email Routing is on, Cloudflare has added locked MX records (route1, route2 and route3.mx.cloudflare.net) and an SPF record with include:_spf.mx.cloudflare.net. Unlock them or disable Email Routing (Compute > Email Service > Email Routing > your domain > Settings) before switching to another provider. Email Routing can't be used with an outside mail server.
How long until Google Workspace email works on Cloudflare?
Cloudflare says Google typically verifies within a few minutes, though DNS propagation can take up to 48 hours. Cloudflare says changes to your DNS records take effect worldwide within 5 minutes, usually much less. A record you replaced can stay cached until its old TTL runs out.
Sources
Every value and step on this page comes from these official pages. Dashboards change, so if something doesn’t match what you see, tell us.
Google Workspace records
- Recommended DMARC rollout (Google Workspace Help)
- RFC 7208: Sender Policy Framework (IETF)
- Set up DKIM (Google Workspace Help)
- Set up DMARC (Google Workspace Help)
- Set up MX records for Google Workspace (Google Workspace Help)
- Set up SPF (Google Workspace Help)
- Verify your domain with a TXT record (Google Workspace Help)
Cloudflare steps and tips
Some of these are other email providers' official guides for Cloudflare. They describe the same Cloudflare dashboard.
Google Workspace on Cloudflare
Google Workspace on other hosts
- Google Workspace on Bluehost
- Google Workspace on GoDaddy
- Google Workspace on Hostinger
- Google Workspace on Namecheap
- Google Workspace on Squarespace Domains
- Google Workspace on Amazon Route 53
- Google Workspace on DreamHost
- Google Workspace on IONOS
- Google Workspace on Name.com
- Google Workspace on Network Solutions
- Google Workspace on OVHcloud
- Google Workspace on Porkbun
- Google Workspace on SiteGround
- Google Workspace on Wix
- Google Workspace on WordPress.com
Other email providers on Cloudflare
- Cloudflare Email Routing on Cloudflare
- Microsoft 365 on Cloudflare
- Zoho Mail on Cloudflare
- Fastmail on Cloudflare
- Hostinger Email on Cloudflare
- iCloud+ Custom Email Domain on Cloudflare
- Migadu on Cloudflare
- Namecheap Private Email on Cloudflare
- Proton Mail on Cloudflare
- Rackspace Email on Cloudflare
- Titan Email on Cloudflare