Mailgun Setup - Google Domain Setup

Modified on: Wed, 1 Jul, 2026 at 7:14 AM

Email Infrastructure
Mailgun + Google Domains Setup
Step-by-step DNS configuration for connecting Mailgun to a domain registered with Google Domains.
What You'll Learn

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.

Video Recap
1

Sign up for Mailgun & add your domain

Step 1

Sign up at Mailgun.com, then check your inbox to verify your email address.

Mailgun signup confirmation screen
Mailgun email verification confirmation
Step 2

Log in to Mailgun, then click Sending → Add New Domain.

Sending menu with Add New Domain option in Mailgun
Step 3

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.
Important

Set up the domain or subdomain under the US region — not EU.

Click Add domain.

Adding a domain in Mailgun
2

Access 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.
DNS management screen in Google Domains
3

Add the 1st TXT record (SPF)

Fields

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.

TXT record form filled with the SPF value in Google Domains
Note

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.

4

Add the 2nd TXT record (DKIM)

Fields

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.

Example of the host name value to copy for the DKIM record
ExampleHighlighted part to copy
Using a subdomainExample of the host value to copy when using a subdomain
Using the main domainExample of the host value to copy when using the main domain

Type: select TXT from the dropdown.

Data: paste the second, longer TXT record here.

Second TXT record form filled with the DKIM value in Google Domains
5

Add the MX records

Click Create new record.

Fields

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
Completed MX record with both mailgun values in Google Domains
6

Add the CNAME record

Click Create new record.

Fields

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.

Completed CNAME record in Google Domains
7

Verify 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.

Verify DNS Settings button in Mailgun
Next Steps

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.

8

Frequently Asked Questions

Q: Why does Google Domains only need one MX record instead of two?
Google Domains lets you add multiple values to a single MX record using "+Add more to this record," so both mxa.mailgun.org and mxb.mailgun.org live under one record instead of two separate ones.
Q: Why shouldn't I click Save after adding just the first record?
You can save at any point, but it's easier to add all 5 records first and save once at the end, rather than saving and reopening the DNS page repeatedly.
Q: Will this affect my existing Google Workspace or Gmail email?
Not if you use a subdomain for Mailgun rather than your main domain, and leave your existing Google Workspace MX records on the main domain untouched.
Q: How long does DNS propagation take in Google Domains?
Usually fast, but it can occasionally take a few hours. If a record isn't showing green yet in Mailgun, wait a bit and click Verify DNS Settings again.
Q: What priority value do I use for the MX record?
Use 10 for both mxa.mailgun.org and mxb.mailgun.org — this is entered right before the value, for example "10 mxa.mailgun.org".
Q: What do I do after all 5 records show a green checkmark?
Grab your Mailgun API key, add it to your email service settings, and send a test email in a conversation to confirm delivery is working.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article