# Namecheap Domain Setup

### Introduction

Setting up custom domains with Mailgun can be a bit challenging for some users. This guide aims to simplify the process, using a video tutorial as a reference. By the end, you'll have a clear understanding of how to set up Mailgun custom domains, particularly with Namecheap, though the principles can be applied to any DNS provider.

### Overview

The process involves:

1. Logging into Mailgun and your DNS provider (Namecheap in this example).
2. Creating a subdomain in Mailgun.
3. Adding the necessary DNS records in your DNS provider.
4. Verifying the DNS records in Mailgun.

1\. Sign up for [Mailgun.com](https://signup.mailgun.com/new/signup)

2\. Check your email inbox to verify the email address

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284378416/original/VewuZVN3oFOFIvBdf4XqMAOX4vtVGv_jNg.png?1677630998" alt=""><figcaption></figcaption></figure>

\
3\. Login to Mailgun, Click on **Sending** > **Add New Domain**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284378418/original/kxsnymCeuFAsBWkXaOes6QaaWED2_bfASA.png?1677630999" alt=""><figcaption></figcaption></figure>

4\. If your domain is companyname.com, you can either set up the main domain or subdomain with Mailgun.&#x20;

A. Main domain:

* If you are adding the main domain,[ it should not be used with Gsuite, or any other email provider](https://help.mailgun.com/hc/en-us/articles/203357040-Can-I-Use-the-Same-Domain-Name-for-Mailgun-and-for-Google-Apps-Or-Another-Email-Server-)&#x20;

&#x20;   Subdomain:

* To set up the subdomain with Mailgun, you can type **ANYTHING\_HERE**.companyname.com
  * Examples:
    * mg.companyname.com
    * replies.companyname.com
    * support.companyname.com

B. Please set up the domain or subdomain under US, **not EU. not EU. not EU.**&#x20;

C. Click on **Add domain**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284382652/original/woVjMqNw3YY_Zjs20LoBHUb4KrThVvj_Rw.png?1677635102" alt=""><figcaption></figcaption></figure>

5\. Now log in to your DNS records based on where you get the domain and add the 5 DNS records.

Log in to [Namecheap.com](https://www.namecheap.com/myaccount/login/)

Click on **Domain List** > **Manage**&#x20;

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379162/original/ZFfDWZRqEj2vF1mZu2LLamthayVacfWNdQ.png?1677631852" alt=""><figcaption></figcaption></figure>

Click on **Advanced DNS**, we are going to add 5 DNS records

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379194/original/lbM_9qwxdQuZYJgoO8k_Bbs6207ECEULCA.png?1677631892" alt=""><figcaption></figcaption></figure>

### To add the 1st TXT record <a href="#to-add-the-1st-txt-record" id="to-add-the-1st-txt-record"></a>

Click on **Add New Record**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379255/original/z9t88DrLLsk_x-5McqcmUoQay6Rtpl-3JA.png?1677631962" alt=""><figcaption></figcaption></figure>

Select **TXT** **Record** from the dropdown

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379274/original/XZhGADHABEyG3gpE2kfSb4glLSsGZ7X29g.png?1677631986" alt=""><figcaption></figcaption></figure>

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379750/original/afOhZ_mYDjiPnMtdsXB_BaUvpK7-fBAbEg.png?1677632454" alt=""><figcaption></figcaption></figure>

A. Host:

Depending on the subdomain you are trying to set up, if you are trying to set up

[mg.companyname.com](https://mg.companyname.com/) The host name will be **mg**

[replies.companyname.com](https://replies.companyname.com/) The host name will be **replies**

If you are setting up a **main** domain like companyname.com, the host name will be **@**

B. Head back to Mailgun and Copy the first TXT record here **v=spf1 include:mailgun.org \~all**

Value: we will paste the first copied TXT record here v=spf1 include:mailgun.org \~all

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379641/original/OtndbakIxEwGec0uzyy6VhrQ9ahdwqWR4g.png?1677632355" alt=""><figcaption></figcaption></figure>

C. Click on the green check

<br>

### To add the 2nd TXT record <a href="#to-add-the-2nd-txt-record" id="to-add-the-2nd-txt-record"></a>

Click on **Add New Record**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380045/original/p3EI2E6cXdPA44wNy1dlbvL9SeMlPsN_pg.png?1677632706" alt=""><figcaption></figcaption></figure>

Select **TXT** **Record** from the dropdown

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380093/original/ymsCp1tf0vOpw8jh_ELv1eyAHoFR08klKA.png?1677632745" alt=""><figcaption></figcaption></figure>

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380135/original/h15o-HQi5ZlCUWfi23NsIp_ULoUljPMbDw.png?1677632789" alt=""><figcaption></figcaption></figure>

A. Host:

it's a bit tricky but the key here is to copy everything from the beginning until the subdomain part, **DO NOT copy the main domain**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284379962/original/S6JIQJ-twEQMWBwUw7Do7908kLEMK8w9gg.png?1677632628" alt=""><figcaption></figcaption></figure>

Examples: **copy the highlighted part**

| <p>Example 1 using subdomain</p><p><br></p>    | [![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380215/original/t6MGY8Bw9AK1Vv01kUxtJAkNwp_4UfYjHw.png?1677632945)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380215/original/t6MGY8Bw9AK1Vv01kUxtJAkNwp_4UfYjHw.png?1677632945) |
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Example 2 using main domain:</p><p><br></p> | [![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380223/original/JSERXQQhYNvzVp7YoXhIji_yeomZNLXUKA.png?1677632951)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380223/original/JSERXQQhYNvzVp7YoXhIji_yeomZNLXUKA.png?1677632951) |

B. Value: we will paste the second long TXT record here&#x20;

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380189/original/a5LTwyG6FV_Hp-L232_fAj2g1VUUDlSyPw.png?1677632888" alt=""><figcaption></figcaption></figure>

C. Click on the green check

### To add the 1st MX records <a href="#to-add-the-1st-mx-records" id="to-add-the-1st-mx-records"></a>

Scroll down to **MAIL SETTINGS**

Switch the dropdown to **Custom MX**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380651/original/s-vIse48Y60uv4ODRMU02N4qsPS5I5uYeg.png?1677633315" alt=""><figcaption></figcaption></figure>

This will affect your existing Gsuite account to capture incoming emails for the main domain if you have **Gmail** selected originally. Make sure you are using a subdomain for Mailgun. Check out [Can I Use the Same Domain Name for Mailgun and for Google Apps (Or Another Email Server)?](https://help.mailgun.com/hc/en-us/articles/203357040-Can-I-Use-the-Same-Domain-Name-for-Mailgun-and-for-Google-Apps-Or-Another-Email-Server-)

<br>

You will need to add back **5** [MX records for Google Gmail:](https://support.google.com/a/answer/140034?hl=en)

| Host | Time to Live (TTL\*) | Priority | Value                   |
| ---- | -------------------- | -------- | ----------------------- |
| *@*  | 3600                 | 1        | ASPMX.L.GOOGLE.COM      |
| *@*  | 3600                 | 5        | ALT1.ASPMX.L.GOOGLE.COM |
| *@*  | 3600                 | 5        | ALT2.ASPMX.L.GOOGLE.COM |
| *@*  | 3600                 | 10       | ALT3.ASPMX.L.GOOGLE.COM |
| *@*  | 3600                 | 10       | ALT4.ASPMX.L.GOOGLE.COM |

Once you add back all **FIVE** MX records above, we can then add our MX records for Mailgun

Click on **Add New Record**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381008/original/Hvcyh4kYnFgfuL6SKPnyDNBFReckD-0qqg.png?1677633693" alt=""><figcaption></figcaption></figure>

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284380997/original/nSuGvsypPVy3uastd0-zS4Dpu71FC2figA.png?1677633659" alt=""><figcaption></figcaption></figure>

A. Host:

Depending on the subdomain you are trying to set up, if you are trying to set up

[mg.companyname.com](https://mg.companyname.com/) The host name will be **mg**

[replies.companyname.com](https://replies.companyname.com/) The host name will be **replies**

If you are setting up a **main** domain like companyname.com, the host name will be **@**

B. Value: paste the following data **mxa.mailgun.org**

C. Priority is 10

D. Click the green check

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381240/original/2nrnlf9BwTPbv5cKXKZS8QStDqfFbqz-7w.png?1677633916" alt=""><figcaption></figcaption></figure>

### To add the 2nd MX records <a href="#to-add-the-2nd-mx-records" id="to-add-the-2nd-mx-records"></a>

A. Host:

Depending on the subdomain you are trying to set up, if you are trying to set up

[mg.companyname.com](https://mg.companyname.com/) The host name will be **mg**

[replies.companyname.com](https://replies.companyname.com/) The host name will be **replies**

If you are setting up a **main** domain like companyname.com, the host name will be **@**

B. Value: paste the following data **mxb.mailgun.org**

C. Priority is **10**

D. Click the green check

[![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381184/original/wao3EJjnKT5qAO1wn_ZxZqBdEusgs_E8Qw.png?1677633856)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381184/original/wao3EJjnKT5qAO1wn_ZxZqBdEusgs_E8Qw.png?1677633856)

### To add the CNAME record <a href="#to-add-the-cname-record" id="to-add-the-cname-record"></a>

Scroll back up to the top section named HOST RECORDS

Click on Add New Record

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381639/original/UJxPcf-rUHX7AwbK1pwp4kMH-N9VjEx62w.png?1677634175" alt=""><figcaption></figcaption></figure>

Select **CNAME Record** from the dropdown

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381737/original/kaXoDz-tFmwEhnhJ-NOwZcvVlkk_b8I-bg.png?1677634268" alt=""><figcaption></figcaption></figure>

Head back to Mailgun to copy the host name, it's a bit tricky but the key here is to copy everything from the beginning until the subdomain part, **DO NOT copy the main domain**

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284382024/original/SKui5c_vVTAOKtN714Bl9mx8OdjgxebDSA.png?1677634552" alt=""><figcaption></figcaption></figure>

Go back to Namecheap:

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284381724/original/zDKUjwzlyWytyho6PuhbQEvKuqGiKzYypQ.png?1677634245" alt=""><figcaption></figcaption></figure>

A. Host:

Depending on the subdomain you are trying to set up, if you are trying to set up

mg.companyname.com The host name will be **email.mg**

replies.companyname.com The host name will be **email.replies**

If you are setting up a **main** domain like companyname.com, the host name will be **email**

B. Value: paste the following data [**mailgun.org**](https://mxa.mailgun.org/)

C. Click the green check

Now that you have added 5 records, Go back to Mailgun and click on **Verify DNS Settings**

Click the same button to **Verify DNS Settings** again if some records are still not showing the green checkmark

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48284382101/original/PQecmA9d0ihGiF3VchOhZL1VKMrOZmUvDQ.png?1677634628" alt=""><figcaption></figcaption></figure>

### Conclusion

Setting up custom domains with Mailgun is a straightforward process once you understand the steps. This guide, combined with the video tutorial, should provide you with all the information you need to successfully set up your custom domain. Remember, while this example used NameCheap, the principles remain the same for other DNS providers.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getgymini.com/gymini/features/features-overview/email/mailgun/setting-up-mailgun/namecheap-domain-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
