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.
Sign up for Mailgun & add your domain
Log in to Mailgun, then click Sending → Add New Domain.

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.

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.

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

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

| Example | Highlighted part to copy |
|---|---|
| Using a subdomain | ![]() |
| Using the main domain | ![]() |
Type: select TXT from the dropdown.
Data: paste the second, longer TXT record here.

Add 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

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

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.

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.



