# Step-by-step guide to set up Mailgun

> EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test…

- Source: https://docs.ghlcustomercare.com/docs/email/mailgun/step-by-step-guide-to-set-up-mailgun
- Section: Email / MailGun
- Reading time: 3 min
- Images: 6, each explained below
- Modified on Wed, 1 Jul at 6:48 AM

---
EMAIL INFRASTRUCTURE

Mailgun Step-by-Step Setup Guide

Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email.

What You'll Learn

This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a subdomain, publishing the required DNS records, and confirming everything works with a test email.

Table of Contents

[1Sign Up for Mailgun](#section-1)

[2Verify Your Email Address](#section-2)

[3Add a New Sending Domain](#section-3)

[4Choose a Main Domain or Subdomain](#section-4)

[5Add Your DNS Records](#section-5)

[6Get Your API Key & Send a Test Email](#section-6)

[7Frequently Asked Questions](#section-faq)

[8Related Articles](#section-related)

## 1Sign Up for Mailgun

Create your Mailgun account by visiting [signup.mailgun.com/new/signup](https://signup.mailgun.com/new/signup).

## 2Verify Your Email Address

Check your email inbox for a message from Mailgun and click the verification link to confirm your account.

![Mailgun signup confirmation screen](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243535009/original/7tQRdPUgguqaYEpnIV2uS3kIQpMd7jZBZw.png)

**Verify Your Email Address (image 1 of 6)**

This screenshot appears in the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

![Email verification confirmation](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243535045/original/kRGmwZtbq3-zkULjp6-Pg0J-7sTNMNHymQ.png)

**Verify Your Email Address (image 2 of 6)**

This screenshot appears in the "Verify Your Email Address" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

## 3Add a New Sending Domain

From your Mailgun dashboard, click **Sending → Add New Domain**.

![Sending menu with Add New Domain option](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243535197/original/doBfy9jAqoxcOqD5LiuyQO9rnyVWfkkAeg.png)

**Add a New Sending Domain (image 3 of 6)**

This screenshot appears in the "Add a New Sending Domain" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

## 4Choose a Main Domain or Subdomain

If your domain is **companyname.com**, you can set up either the main domain or a subdomain with Mailgun.

Option A

Main Domain

If you add the main domain, it should not already be in use with Google Workspace or any other email provider.

Option B

Subdomain

To set up a subdomain with Mailgun, you can type **anything\_here.companyname.com**. Examples:

-   mg.companyname.com
-   replies.companyname.com
-   support.companyname.com

Note

Set up the domain or subdomain under the **US** region, not EU. Once you've made your selection, click **Add domain**.

![Add domain form with US region selected](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243536037/original/B5DZocdO2h64MlEDtfuFjER-U_0AO_NOEg.png)

**Choose a Main Domain or Subdomain (image 4 of 6)**

This screenshot appears in the "Choose a Main Domain or Subdomain" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

Setup Guide

Now let's publish the DNS records

This is the step most setups get stuck on — follow it carefully.

## 5Add Your DNS Records

Log in to your DNS host based on where you registered the domain, and add the 5 DNS records Mailgun provides.

Not Sure Where to Add the Records?

Step 1: Look up your domain in MXToolbox

Search your domain in [MXToolbox](https://mxtoolbox.com/SuperTool.aspx). Only enter the domain itself — do not add "http://" in front of it.

![MXToolbox domain lookup search bar](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243537503/original/VQuAatUlq58RsSVIlLqFfKJQsi1EtB2pjg.png)

**Add Your DNS Records (image 5 of 6)**

This screenshot appears in the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

Once you look up the domain, the results will show your DNS hosting provider.

![MXToolbox results showing DNS hosting provider](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48243537328/original/O4VqrFqJo6APt8Z_bhPobo_S50QD230bQg.png)

**Add Your DNS Records (image 6 of 6)**

This screenshot appears in the "Add Your DNS Records" section of "Step-by-step guide to set up Mailgun". For context, this section explains: EMAIL INFRASTRUCTURE Mailgun Step-by-Step Setup Guide Sign up for Mailgun, add your sending domain, configure your DNS records, and send your first test email. What You'll Learn This guide walks you through creating a Mailgun account, adding a sending domain, choosing between a main domain and a…. This part of the guide covers 3 fields, listed below.
- Fields: mg.companyname.com, replies.companyname.com, support.companyname.com
- Controls: Sending → Add New Domain, companyname.com, anything_here.companyname.com, US, Add domain, [provider name] DNS records, GoDaddy, Namecheap, Siteground, HostGator, Google Domains, CloudFlare

Full procedure:

1. mg.companyname.com
2. replies.companyname.com
3. support.companyname.com

Step 2

Check the "reported by" note

MXToolbox will show a note at the bottom naming your host, e.g. "reported by wordpress.com." Once you know your provider, you can add the DNS records in that provider's dashboard. If you're not sure where to find the DNS records area, search "**\[provider name\] DNS records**."

Based on your domain provider, use one of these step-by-step guides to add the records. If your provider isn't listed, one of these should still be a close match:

[**GoDaddy** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-godaddy-domain-setup) [**Namecheap** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-namecheap-domain-setup) [**Siteground** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-siteground-domain-setup) [**HostGator** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-hostgator-domain-setup) [**Google Domains** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-google-domain-setup) [**CloudFlare** — Mailgun domain setup](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-setup-cloudflare-domain-setup)

## 6Get Your API Key & Send a Test Email

Once all of your DNS records are added and verified, grab your key from [Mailgun API Key: Where to Find It in Mailgun and Add It to the Platform](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-private-api-key-setup).

You're Almost Done

Send a test email to confirm everything works. See [How to Send a Test Email in the Conversation](https://docs.ghlcustomercare.com/docs/email/troubleshooting-email/how-to-send-a-test-email-in-the-conversation) for the steps.

## 7Frequently Asked Questions

Q: Should I use my main domain or a subdomain?

A subdomain (like mg.companyname.com) is usually the safer choice, since your main domain shouldn't be added if it's already in use with Google Workspace or another email provider.

Q: Why does it matter whether I choose US or EU when adding the domain?

The region determines which Mailgun infrastructure sends your mail. Always select US when setting up your domain or subdomain for this workflow.

Q: I don't know who my DNS provider is — how do I find out?

Look up your domain in MXToolbox. The results page will show a "reported by" note naming your DNS host.

Q: My domain provider isn't in the list of guides — what should I do?

Use one of the listed provider guides as a reference — the process of adding TXT, CNAME, and MX records is similar across most DNS hosts.

Q: How long does it take for DNS records to verify?

DNS propagation can take anywhere from a few minutes to 48 hours, though most records verify within an hour.

Q: My test email didn't go through — what should I check first?

Confirm all 5 DNS records show as verified in Mailgun, and double-check that your API key was entered correctly before sending another test.

Related Articles

[Mailgun API Key: Where to Find It in Mailgun and Add It to the Platform](https://docs.ghlcustomercare.com/docs/email/mailgun/mailgun-private-api-key-setup) [How to Send a Test Email in the Conversation](https://docs.ghlcustomercare.com/docs/email/troubleshooting-email/how-to-send-a-test-email-in-the-conversation)

---

Documentation for GHL Customer Care. Support: support@ghlcustomercare.com