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

2. Check your email inbox to verify the email address

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

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

A. Main domain:

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.

C. Click on Add domain

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

Click on Domain List > Manage

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

To add the 1st TXT record

Click on Add New Record

Select TXT Record from the dropdown

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 mg

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

C. Click on the green check

To add the 2nd TXT record

Click on Add New Record

Select TXT Record from the dropdown

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

Examples: copy the highlighted part

Example 1 using subdomain

Example 2 using main domain:

B. Value: we will paste the second long TXT record here

C. Click on the green check

To add the 1st MX records

Scroll down to MAIL SETTINGS

Switch the dropdown to Custom MX

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)?

You will need to add back 5 MX records for Google Gmail:

HostTime to Live (TTL*)PriorityValue

@

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

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 mg

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

To add the 2nd MX records

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 mg

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

To add the CNAME record

Scroll back up to the top section named HOST RECORDS

Click on Add New Record

Select CNAME Record from the dropdown

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

Go back to Namecheap:

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

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

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.

Last updated