Setting up Mailgun DNS records with Namecheap domains
The settings Iβve described above should let you use Mailgun with your domain. In case you stumbled on the same blocks I encountered, I hope you find this helpful! π
Syndicated on Medium.
Mailgun is a service that lets developers programmatically send and receive emails. Namecheap is a domain registrar. I wanted to setup Mailgun to use custom email with the domain I manage using Namecheap. But I stumbled on some issues with settings.
I eventually got it working, and Iβm sharing my solutions here just in case someone else hits the same blocks with these (or other) email and domain services.
Letβs get to it!
By this point, you have already added your domain to Mailgun. Now you need to add Mailgun-related DNS records to your domain.
While setting up, I followed the steps given by Mailgun. For each record it came down to:
- Choosing a type of record from the dropdown
- Setting the hostname
- Entering the DNS value, which is given to me by Mailgun (Iβve not included this in the screenshots later on, because security ππ½)
But their recommended entries (see screenshots) at steps 2 did not work for me.
Instead I did the following.
SPF & DKIM
For the first TXT record, it asked me to put the domain as the hostname. I used the @
sign instead, because Namecheap uses the β@β sign to represent your domain.
For the second TXT record, it said to enter a hostname that was foo.bar.my-domain
. Instead I used only the foo.bar
portion.
MX records
MX records are mail server records. In the Mail Settings section of the Advanced DNS panel on your Namecheap interface, select Custom MX so you can enter your Mailgun records.
The section about MX records in the Mailgun guide did not mention it but you need to set the host as your domain. So under host, put @
. Also just set TTL (time to live) as Automatic.
Now, Mail Settings on the Advanced DNS panel should look like this.
CNAME record
By now the setup is enough for Mailgun to verify your DNS. This last one is considered optional.
Instead of entering email.your-domain
in the hostname field, just enter email
as the hostname. Also remember, that here in the value field, the page tries to be smart. Mail server names should end with a period (β.β). If the form field recognizes the mail server name (as it does with Mailgun), it will automatically insert a period. Donβt let it throw you off. Thatβs ok.
The settings Iβve described above should let you use Mailgun with your domain. In case you stumbled on the same blocks I encountered, I hope you find this helpful! π