This step-by-step guide will walk you through how to add and verify a domain in Mailgun.
Verifying your domain is an essential step to start sending email through Mailgun. We ask all of our users to verify ownership to enable open and click tracking, mitigate spam, and ensure that nobody can send from your domain besides you and your organization.
If your domain is already hosted somewhere, you’ll need to login to your provider to change DNS records. If your domain isn’t hosted anywhere yet, you can setup an account at a provider like Cloudflare, Google Domains, GoDaddy, or Namecheap.
Pro-Tip: We have guides for some of the most popular DNS hosting providers below in Step 2.
Step 1: Add Your Domain to Mailgun
(If you’ve already added your domain, skip to step 2.)
Before you can verify a domain, it needs to be added to Mailgun. We'll guide you using the steps below:
- First, log in to the Mailgun Control Panel (if you have not already done so)
- Then, within the left-hand navigation pane, click the Sending option to expand its list of suboptions.
Next, click the Domains suboption.
- To add a domain, click the Add New Domain button.
- Fill in the required information and click the Add Domain button.
As for choosing a domain, we recommend using a subdomain for better email deliverability. In this example, we used mail.yourdomain.com. If you want to use just your domain name, that’s (usually) fine too.
The next screen that you're taken to will ask you to add DNS records to your domain. Leave this screen open for the next step.
Step 2: Add DNS Records to Hosting Provider
(Use one of the available guides if your DNS provider is listed below.)
Next, you’ll be asked what type of DNS records you want to add. We’ll go through each one individually below so that you have a general idea of how to add these to your DNS hosting provider. However, we do have in-depth, step-by-step guides for the following DNS providers below:
The first records Mailgun asks you to add are TXT records. We will add two separate TXT records, one for SPF and one for DKIM. These are required to send and receive email with Mailgun.
If you’re using a subdomain, add a new TXT record with mail.yourdomain.com as the hostname (with certain providers, you may just have to enter the subdomain, which would just be mail in this case) and the appropriate value Mailgun provides. You can leave TTL as the default option.
If you’re not using a subdomain, most providers will accept @ as the hostname when creating DNS records for the root domain. Here’s an example:
Clicking Add Record will add your first DNS entry for your domain!
Add another TXT record for mx._domainkey.mail.yourdomain.com. Cloudflare only shows the subdomain, so your result will look like this:
Next, you need to add MX records. Mailgun requires you to add two separate MX records.
You will add the MX records the same way you did with the TXT records. The hostname in this case is mail.yourdomain.com You’ll also be asked for priority, which should be 10.
Lastly, you will need to add a CNAME record. The CNAME Record is what enables Open and Click tracking. This is highly recommended to reap the full benefit of Mailgun and gain insights into your email performance.
Add the CNAME the same way as the others. The hostname here is email.mail.yourdomain.com
Step 3: Wait (Up To 24-48 Hours)
It can take up to 24 to 48 hours for DNS changes to propagate across the internet. In our experience, it usually happens faster than that, but don’t get discouraged if it doesn’t happen immediately. If everything is setup right you’ll receive an email from Mailgun like this:
If you’re impatient like us, you can also use the ‘Check DNS Records Now’ button on the DNS Settings page.
For additional troubleshooting scenarios and tips should you need them, please refer to this article.
Sinch Mailgun has answers! If you have any concerns or questions, please send us a Support ticket using the Support page within your Mailgun Control Panel. Our Support Team will be happy to assist!