Mailgun Setup - Namecheap Domain Setup

Modified on Tue, 8 Oct at 3:36 PM

Step-by-step Mailgun Setup - Namecheap Domain Setup


1. Sign up for Mailgun.com.


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


3. Log in to Mailgun, click on Sending > Add New Domain.



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


4. A. Main domain:

  • If you are adding the main domain, it should not be used with Gsuite or any other email provider.

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 the US, not the EU.


C. Click on Add domain.


5. Now log in to your DNS records based on where you got 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: 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: Paste the second long TXT record here.



C. Click on the green check.


To add the 1st MX record:


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. 


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


HostTime to Live (TTL*)PriorityValue
@36001ASPMX.L.GOOGLE.COM
@36005ALT1.ASPMX.L.GOOGLE.COM
@36005ALT2.ASPMX.L.GOOGLE.COM
@360010ALT3.ASPMX.L.GOOGLE.COM
@360010ALT4.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:

  • 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: 10.


D. Click the green check.



To add the 2nd MX record:


A. Host:

Depending on the subdomain 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: 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:

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



Once you add all the DNS records and verify, you can grab the Mailgun API Key and place it in the platform.


Then, send a test email to see if everything works!

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