Mailgun Setup - Google Domain Setup
Email Infrastructure Mailgun + Google Domains Setup Step-by-step DNS configuration for connecting Mailgun to a domain registered with Google Domains…
Assistants need to reach this page over the internet. While it is only running on your machine, these two buttons will not be able to load it.
On this page
This guide walks through signing up for Mailgun, adding your domain, and configuring the five DNS records Mailgun requires — two TXT records, both MX values, and one CNAME — inside Google Domains.
It also covers how to avoid breaking your existing Google Workspace/Gmail mail delivery while adding Mailgun's records.
1Sign up for Mailgun & add your domain
Sign up at Mailgun.com, then check your inbox to verify your email address.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Log in to Mailgun, then click Sending → Add New Domain.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
If your domain is companyname.com, decide whether to set up the main domain or a subdomain with Mailgun.
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Set up the domain or subdomain under the US region — not EU.
Click Add domain.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
2Access DNS records in Google Domains
Now log in to your DNS records and add the 5 DNS records Mailgun requires.
- Log in to domains.google.com.
- Click into the domain you're trying to set up.
- Click DNS on the left panel — this is where you'll add all 5 records.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
3Add the 1st TXT record (SPF)
Host name:
- mg.companyname.com → host name is mg
- replies.companyname.com → host name is replies
- Main domain (companyname.com) → host name is @
Type: select TXT from the dropdown.
Data: paste the first copied TXT record — v=spf1 include:mailgun.org ~all.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Don't click Save yet — there are 4 more records to add. Once you've finished this record, click Create new record and move to the next section.
4Add the 2nd TXT record (DKIM)
Host name: this part is a little tricky. Copy everything from the beginning of the value up until the subdomain part — do not copy the main domain.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
| Example | Highlighted part to copy |
|---|---|
| Using a subdomain |
Fields in this part of the guide
mg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referenced
Sending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDNSmgreplies@TXTCreate new recorddo not copy the main domain
Example values
Illustrative values showing the expected format. They are not read from the screenshot. All 2 steps in this procedure
|
| Using the main domain |
Fields in this part of the guide
mg.companyname.com → host name is mgreplies.companyname.com → host name is repliesMain domain (companyname.com) → host name is @Main domain → host name is @mg.companyname.com → host name is email.mgreplies.companyname.com → host name is email.repliesMain domain (companyname.com) → host name is email
Buttons and menus referenced
Sending → Add New Domaincompanyname.comANYTHING_HEREUSAdd domainDNSmgreplies@TXTCreate new recorddo not copy the main domain
Example values
Illustrative values showing the expected format. They are not read from the screenshot. All 2 steps in this procedure
|
Type: select TXT from the dropdown.
Data: paste the second, longer TXT record here.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
5Add the MX records
Click Create new record.
Host name:
- mg.companyname.com → host name is mg
- replies.companyname.com → host name is replies
- Main domain → host name is @
Type: select MX from the dropdown.
Data: Google Domains lets you add both MX values to the same record.
- Copy and paste 10 mxa.mailgun.org
- Click +Add more to this record
- Copy and paste 10 mxb.mailgun.org
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
6Add the CNAME record
Click Create new record.
Host name:
- mg.companyname.com → host name is email.mg
- replies.companyname.com → host name is email.replies
- Main domain (companyname.com) → host name is email
Type: select CNAME from the dropdown.
Data: copy and paste mailgun.org.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
7Verify DNS & finish setup
Now that you've added all 5 DNS records, click Save.
Go back to Mailgun and click Verify DNS Settings. If some records still aren't showing a green checkmark, click the same button again — DNS propagation can take a little time.
- Main domain (companyname.com) → host name is email
- priya.raman@northgatedental.com
Illustrative values showing the expected format. They are not read from the screenshot.
All 2 steps in this procedure
- Main domain: if you use the main domain, it should not also be used with Google Workspace or any other email provider — see Mailgun's guidance on sharing a domain with another email server.
- Subdomain: type ANYTHING_HERE.companyname.com — for example mg.companyname.com, replies.companyname.com, or support.companyname.com.
Once all records are verified, grab your Mailgun API key and add it to your email service settings.
Then send a test email to confirm everything works — see how to send a test email in the Conversation.
8Frequently Asked Questions
Was this guide helpful?