This comprehensive guide will walk you through the process of adding and verifying a domain in Mailgun, an essential step before you can start sending emails through their platform.
Domain verification is crucial as it enables open and click tracking, helps mitigate spam, and ensures that only you and your organization can send emails from your domain.
If your domain is already hosted with a provider, you'll need to access your account to modify the DNS records. If you don't have a domain host yet, you can create an account with providers like Cloudflare, Google Domains, GoDaddy, or Namecheap.
Pro-Tip: We provide specialized guides for popular DNS hosting providers in Step 2.
If you've already added your domain, you can skip to step 2.
Prefer videos? This section includes a video walkthrough demonstrating how to add a domain to Mailgun and configure DNS records with a hosting provider.
[INSERT VIDEO SCREENSHOT HERE]
Before verifying a domain, you need to add it to Mailgun by following these steps:
After adding your domain, you'll be directed to a screen asking you to add DNS records. Keep this screen open for the next step.
If your DNS provider is listed below, you can use our specialized guides:
You'll need to add several types of DNS records. We'll explain each one individually so you understand how to add them to your DNS hosting provider. Note that the exact process may vary slightly depending on your specific DNS host.
The first records Mailgun requires are TXT records. You'll need to add two separate TXT records, one for SPF and one for DKIM. These are essential for sending and receiving email with Mailgun.
Note: If you already have an existing SPF record for this root domain, you cannot add another SPF record.
Instead, you will insert the value include:mailgun.org into your existing SPF record. Ensure this value is placed somewhere after v=spf1 and somewhere before ~all. Also, ensure this value has one space character to its left and one space character to its right.
For example, v=spf1 include:domain1.com include:mailgun.org include:domain3.com ~all

If using a subdomain:
mail.yourdomain.com as the hostname (some providers may only require you to enter mail)If using the root domain:
@ as the hostname when creating DNS records for the root domainAfter adding the first record, add another TXT record for mx._domainkey.mail.yourdomain.com. Some providers like Cloudflare may only show the subdomain portion.
Next, you need to add two separate MX records:
mail.yourdomain.com as the hostname10
Finally, you need to add a CNAME record, which enables Open and Click tracking. This is highly recommended to gain valuable insights into your email performance.
Add the CNAME with email.mail.yourdomain.com as the hostname and the value provided by Mailgun.
DNS changes can take up to 24-48 hours to propagate across the internet. In our experience, it usually happens faster, but don't be discouraged if verification isn't immediate.
When everything is set up correctly, you'll receive a confirmation email from Mailgun:
If you're impatient, you can use the 'Check DNS Records Now' button on the DNS Settings page to verify your setup manually.
If you encounter any issues during the setup process, Mailgun's support team is available to assist you. You can reach out through their support portal or check their comprehensive documentation for additional guidance from here.