Overview
This guide demonstrates how to add a root domain or subdomain to Namecheap and configure the (sub)domain with each Mailgun DNS record. This guide assumes that you have already created your Namecheap account.
While this guide is intended to be as helpful and comprehensive as possible, there is a small possibility that you will encounter an error or issue of some kind while configuring your DNS records within Namecheap. If that is the case, we recommend contacting Namecheap's Support Team as they will be able to most quickly identify and resolve the issue (or, at minimum, provide next steps).
Deciding between a root domain or subdomain
Deciding which domain to use - especially whether to use your root domain or a subdomain of that root domain - is key before proceeding any further. As this can be a challenging decision to make, we recommend reviewing the following Mailgun articles if needed:
- Choosing a domain name
- The basics of email subdomains
- Can I use the same domain name for Mailgun and my personal email account?
Nevertheless, let's briefly review two key terms: root domains and subdomains.
Examples of root domains include mailgun.com, mydnsexample.com, or google.com. Examples of subdomains include relay.mailgun.com, mg.mydnsexample.com, or mail.google.com. Notice the pattern: subdomains have an extra prefix (or sometimes multiple prefixes) before the primary domain name itself. In most cases using a subdomain with Mailgun is preferred, but we cover this topic more comprehensively in the above articles.
Finally, once a decision has been reached, add the (sub)domain to your Mailgun account, and our system will generate the various DNS records needed . We cover adding (and deleting) domains in detail within this in-depth guide.
Adding the domain
There are three methods of adding a domain or subdomain within Namecheap:
- Method 1: Registering a new domain/subdomain with Namecheap
- Method 2: Transferring an existing (sub)domain's registration from another Domain Registrar to Namecheap
- Method 3: Configuring an existing (sub)domain's nameservers within the Domain Registrar to reference Namecheap rather than the current DNS provider
The first method of adding a (sub)domain within the Namecheap Control Panel only takes 5 steps, and this is covered in this guide. We will list those steps below, but if desired, you can also reference Namecheap's Adding (Buying) A Domain articles. If you already have a domain purchased and registered elsewhere, you'll need to transfer the domain to Namecheap (see the next paragraph).
However, the second method of adding a (sub)domain within the Namecheap Control Panel is not covered in this article; nonetheless, Namecheap documents how the transfer process works within their system. Transferring a domain's registration between Domain Registrars is an intricate process, and a mistake can have catastrophic impact upon your online presence. Therefore, it is our recommendation to contact the Domain Registrar if you have any questions or encounter any issues regarding with the Domain Registration and Nameserver Management processes. See also section "The Domain Registrar And Nameserver Records" of the guide for more details.
A third method, configuring an existing (sub)domain's nameservers within the Domain Registrar to reference Namecheap rather than the current DNS provider, is partially covered in this guide. Similar to the explanation in the second method above, changes in your Domain Registrar must be carefully and precisely made. As such, working directly with the Domain Registrar may be imperative for ensuring the nameserver (NS) records are updated appropriately. Nonetheless, we cover the Namecheap side of the equation below.
Tip: For larger images, right-click and select the option "Open Image in New Tab" (or Window).
Don't own a domain or need a new domain? (First Method)
If you need to create a new (sub)domain and have it hosted with Namecheap, follow the below steps to register your new domain (or subdomain) with Namecheap.
-
Login to your account.
-
Enter the new domain name you wish to add (buy/purchase) from Namecheap inside the doman search textbox (i.e. it is found under the Greeting, Login, Account Balance, and Two Factor Authentication statuses).
-
Choose the desired domain ending (.TLD) for your domain. Then, click the Checkout button
- If shown, choose any additional options and proceed to the next page by clicking the Confirm Order button.
-
Enter your contact information for ICANN and complete the domain registration process. Billing and other setup details will be finalized as well.
Already own a domain hosted somewhere else? (Third Method)
If you already own an existing (sub)domain that is registered elsewhere with another Domain Registrar, but you would like to manage the DNS at Namecheap, this is possible by performing the following steps of adding DNS:
-
Login to your account.
-
Hover over the Domains tab in the top navigation pane to display a list of options. Then, click the FreeDNS option. (If you have PremiumDNS, the process is very similar).
-
Enter your existing (sub)domain in the textbox. Then, click the Get DNS button.
-
Click either the shopping cart icon present on the row containing your domain or the Add to Cart button. Then, click the Set up DNS button.
- Namecheap displays the specific NS records you'll need to use within your Domain Registrar. You can skip this for the moment and proceed with configuring the Mailgun DNS records within Namecheap (please save these records for later in your notes), but you will need to ensure the Namecheap NS records are configured within your Domain Registrar before the Mailgun DNS records will propagate globally and become effective for your domain.
-
Hover over the Account tab in the top navigation pane to display a list of options. Then, click the Dashboard option.
- You'll see a list of domains in the center of the page. For the desired domain, hover over the house icon under the Products column to display a list of options and click the Advanced DNS option.
-
View, create, or edit the desired DNS records for the domain.
Configuring the domain
Once the domain has been added, you may access it in the future using the following steps.
- If you're shown the Home page upon login, you'll see a list of domains in the center of the page.
- For the desired domain, hover over the house icon under the Products column to display a list of options and click the Advanced DNS option.
-
View, create, or edit the desired DNS records for the domain.
Configuring SPF
SPF records help protect your domain against spoofed emails and decrease* the likelihood your emails will be flagged as spam. (* Exceptions apply: e.g. actual spam/phishing emails will still be considered as such by mailbox providers even with the presence of an SPF record.)
Additionally to our guide, Namecheap does provide their own SPF tutorial (though it is generalized for each type of record in their system). Interested in more extensive technical details concerning SPF records? Please reference this Mailgun article, RFC 7208, or Namecheap's technical documentation.
Tip: For larger images, right-click and select the option "Open Image in New Tab" (or Window).
Configuring a root domain with the SPF record
Within your Namecheap Control Panel, enter the SPF record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example domain called mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
TXT Notes:
|
Host |
@ Notes:
|
Value |
v=spf1 include:mailgun.org ~all Notes:
|
TTL |
5 min Notes:
|
Configuring a subdomain with the SPF record
Within your Namecheap Control Panel, enter the SPF record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example subdomain called mg.mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
TXT Notes:
|
Host |
mg Notes:
|
Value |
v=spf1 include:mailgun.org ~all (or, possibly only include:mailgun.org) Notes:
|
TTL |
5 min Notes:
|
Configuring DKIM
DKIM records help authenticate your domain against forged emails and decrease* the likelihood your emails will be flagged as spam. (* Exceptions apply: e.g. actual spam/phishing emails will still be considered as such by mailbox providers even with the presence of an DKIM record.)
Additionally to our guide, Namecheap does provide their own DKIM tutorial (though it is generalized for each type of record in their system). Interested in more extensive technical details concerning DKIM records? Please reference this Mailgun article, RFC 6376, or Namecheap's technical documentation.
Tip: For larger images, right-click and select the option "Open Image in New Tab" (or Window).
Configuring a root domain with the DKIM record
Within your Namecheap Control Panel, enter the DKIM record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example domain called mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
TXT Notes:
|
Host |
pic._domainkey Notes:
|
Value |
k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUA Notes:
|
TTL |
5 min Notes:
|
Configuring a subdomain with the DKIM record
Within your Namecheap Control Panel, enter the DKIM record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example subdomain called mg.mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
TXT Notes:
|
Host |
pic._domainkey.mg Notes:
|
Value |
k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUA Notes:
|
TTL |
5 min Notes:
|
Configuring MX
MX records describe where emails intended for your domain should be sent.
Additionally to our guide, Namecheap does provide their own MX tutorial (though it is generalized for each type of record in their system). Interested in more extensive technical details concerning MX records? Please reference RFC 5321 or Namecheap's technical documentation.
Tip: For larger images, right-click and select the option "Open Image in New Tab" (or Window).
Configuring a root domain with the MX records
Within your Namecheap Control Panel, enter the MX records information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example domain called mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Note: MX records are not listed in the default list of records within NameCheap. To add MX records, you must change the Email Settings option to "Custom MX".
Field | Enter |
---|---|
Type |
MX Notes:
|
Host |
@ Notes:
|
Value |
mxa.mailgun.org mxb.mailgun.org Notes:
|
Priority (Not Labeled) |
10 Notes:
|
TTL |
5 min Notes:
|
Configuring a subdomain with the MX records
Within your Namecheap Control Panel, enter the MX records information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example subdomain called mg.mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Note: MX records are not listed in the default list of records within NameCheap. To add MX records, you must change the Email Settings option to "Custom MX".
Field | Enter |
---|---|
Type |
MX Notes:
|
Host |
mg Notes:
|
Value |
mxa.mailgun.org mxb.mailgun.org Notes:
|
Priority (Not Labeled) |
10 Notes:
|
TTL |
5 min Notes:
|
Configuring CNAME
CNAME records alias (point or direct) one domain name to another domain name, which in this case effectively associates your emails with Mailgun and allows tracking of opens and clicks.
Additionally to our guide, Namecheap does provide their own CNAME tutorial (though it is generalized for each type of record in their system). Interested in more extensive technical details concerning MX records? Please reference RFC 1034 or Namecheap's technical documentation.
Tip: For larger images, right-click and select the option "Open Image in New Tab" (or Window).
Configuring a root domain with the CNAME record
Within your Namecheap Control Panel, enter the CNAME record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example domain called mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
CNAME Notes:
|
Host |
Notes:
|
Value |
mailgun.org Notes:
|
TTL |
5 min Notes:
|
Configuring a subdomain with the CNAME record
Within your Namecheap Control Panel, enter the CNAME record information that is displayed in your Mailgun Control Panel. (In the Mailgun Control Panel, you'll click on the Sending option followed by the Domain settings suboption found within in the left-hand navigation pane, and then click on the DNS records tab).
Both the image above and the table below - using an example subdomain called mg.mydnsexample.com - provide additional guidance for adapting certain values (such as the Hostname) into Namecheap's system. Other DNS nuances and problematic scenarios that you may encounter are also explained in detail. Generally, the bolded-in-blue-text within the table can be copied-and-pasted for each field, unless it is noted otherwise (such as the DKIM value, which is unique for every Mailgun domain).
Field | Enter |
---|---|
Type |
CNAME Notes:
|
Host |
email.mg Notes:
|
Value |
mailgun.org Notes:
|
TTL |
5 min Notes:
|
The domain registrar and nameserver records
A somewhat common situation we witness concerns a customer having recently migrated (or currently being in the process of migrating) from one DNS hosting provider to another; however, their Mailgun DNS records are failing to verify within their Mailgun Control Panel. Perhaps you yourself are experiencing this exact situation. If so, there is a solution: update the domain's registration information.
Whenever anyone switches DNS hosting providers (e.g. from GoDaddy to Namecheap), they must also update their Nameserver (NS) records within their Registrar's system. Your Registrar is the company through whom you purchased the domain and with whom the domain is registered on the Internet. As a note, Namecheap is a Domain Registrar, but they may not be your domain's Registrar.
If you need assistance identifying the Registrar for your domain, the ICANN WHOIS website can assist you in this task. Alternatively, you can use a MacOS/Linux terminal to obtain this information:
Scan the output results for the line that contains the Registrar URL information. It is this field that will identify the domain's Registrar and their website.
For more guidance on updating your registrar and the associated nameserver records to reflect your DNS hosting with Namecheap, please review Namecheap's nameserver documentation and registration documentation. Additionally, if you're experiencing a domain registration issue, it is best to reach out to the Registrar directly. Mailgun, in such a scenario, would not have any insight additional to the publicly available WHOIS information mentioned above.
Need Support?
Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support page of your Mailgun Control Panel, and we'll be with you shortly!