Updating TXT records in Namecheap for Mailgun domain verification

While setting up the mailing services for TraitLab, I ran into some problems with domain verification. I’m using Namecheap to manage the domain and setting up transactional email with Mailgun.

To verify the domain, Mailgun requires the addition of at least two TXT records with specific values. However, if you add the TXT records in Namecheap exactly as specified by Mailgun, Mailgun will not be able to verify the domain, and you won’t be able to send email from your application. :(

If you owned yourdomain.com, Mailgun suggests adding two TXT records with the host entries mg.yourdomain.com and mx._domainkey.mg.yourdomain.com. For Traitlab, those looked like this:

Required TXT records from Mailgun What Mailgun says you need

Instead, drop the yourdomain.com from each host entry, so the resulting entries are simply mg and mx._domainkey.mg. In your Namecheap DNS settings, it should look something like this:

Required TXT records from Namecheap What you actually need in Namecheap

After making this change, Mailgun was able to verify the domain in a few minutes!