Verifying Your Domain with Mailgun on DigitalOcean

Ghost's instructions for configuring email on a self-hosted version were pretty vague.

If you are encountering issues verifying your domain & DNS records, Mailgun points you to this setup for DigitalOcean. It was extremely helpful and prevented me from having a complete meltdown. (As well as this post.)

However, I was still having issues with my TXT records. Of the two, one would return verified and the other not. I experimented with switching the values between the two records on DigitalOcean. Immediately, the other TXT record was verified, but now the first wasn't recognized.

This led me to determine it was an issue with the hostname. The fix for me was to have one TXT record's hostname be "@" instead of "mg.domain.com" and to remove "mg.domian.com" from the other hostname, leaving it only "smtp._domainkey".

Recap:
  • Place values within "quotes" on DigitalOcean
  • Use "@" instead of "mg.domain.com" for the first hostname
  • Remove "mg.domain.com" from the second hostname leaving only "smtp._domainkey"

Good luck and hope this helps someone else out!