Quickly add GSuite (Google Apps) MX Records to CloudFlare DNS

Alex Brown
Sep 14, 2018 · 2 min read

by alex

image
image

As some people know, I run a web development agency called Cohoda LTD.

As part of our service, like most development agencies, we offer web hosting. To keep things as lean as possible, we deliberately don’t try to host email servers ourselves, instead we set up clients with email on Google GSuite (or Office 365 if the client prefers)
I always (where possible) use CloudFlare for DNS, and found myself repeatedly entering the same MX records for each domain, time and time again.

CloudFlare has a handy “Upload DNS File” feature tucked under ‘Advanced’ at the bottom of your DNS entries.

Here, you can specify any file to upload (which must conform to the BIND format to work) On upload, those DNS entries will be added. Here’s one for quickly adding GSuite (Google Apps / Gmail) mx records to CloudFlare:

MX Records
@ 1 IN MX 10 alt4.aspmx.l.google.com.
@ 1 IN MX 1 aspmx.l.google.com.
@ 1 IN MX 10 alt3.aspmx.l.google.com.
@ 1 IN MX 5 alt2.aspmx.l.google.com.
@ 1 IN MX 5 alt1.aspmx.l.google.com.

Simply save this as (for example) `gsuite-cloudflare.txt` and upload that when you want to quickly add Google Apps mx records to your domain in CloudFlare.
Source

alexjamesbrown

Blog of Alex, primarily software development ramblings

Alex Brown

Written by

Freelance / contract .net developer

alexjamesbrown

Blog of Alex, primarily software development ramblings

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade