DNS, Mailgun, and I’m Losing My Mind

by Aaron Reimann

October 1, 2018

I became slightly balder today because I pulled most of what was left out. I was trying to set up Mailgun to send mail within a WordPress site. Hosting companies like WP Engine don’t allow mail to be sent using the “built-in” SMTP server and they recommend using a 3rd party tool. That’s totally fine, Sideways8 has been using SendGrid for years, but have started using Mailgun because it is slightly cheaper (or free) for our clients.

Here’s the deal, and this is why I am writing this. Mailgun’s documentation is either wrong, or misleading, at best. Hopefully, someone in the world finds this and I am saving them time.

For this example, let’s say the site I am working is v_mail.com. Mailgun recommends using a subdomain, so I followed their suggestion and I created the domain mg.v_mail.com (mg is shorter than mailgun, but you can use whatever subdomain you want.

See? I have mg.v_mail.com set up.

The SPF record (the first one with the green checkmark) was easy and works great. It is the second record that was the issue, the DKIM. Notice that DKIM has “krs._domainkey” bolded.

It would make sense that your DNS record should be set up to just containing “krs._domainkey”, basically the bolded part, but that is not the case. You won’t get a pretty green check mark if you do that. So I tried the full string of “krs_domainkey.mg.v_mail.com” but that didn’t work.

Apparently, it isn’t the full domain, nor the bolded part, for you to get the green check mark, you have to use “krs._domainkey.mg”. Obviously, if you aren’t using a subdomain like “mg”, then your record would be “krs._domainkey”.

Here is how GoDaddy’s entries look like:

I hope that helps someone.

related posts

Have a WordPress Expert Look at Your Site

ClockworkWP has the privilege to “inherit” sites from other developers on a regular basis. Each…

Three Articles For GoDaddy

Writing articles on my personal blog and Sideways8’s blog has always been fun. I’ve been…

WP Grunt Child

I found it frustrating that I had to write regular CSS and JS when working…