When setting up Mailgun (MG) & Digital Ocean (DO) I ran into unexpected complications. Unfortunately DNS configuration feedback l∞p takes long time (as DNS settings propagate), so it ended taking me some days just to try couple configurations. There are some misleading tutorials out there as-well, so hopefully I can clear it once for all.
So the first gotcha with DO is that the domain name is automatically added to the DNS records, therefore if MG setting says
email.fadeit.dk, then that means only
Second gotcha requires us to wrap TXT record value in quotes:
So-far we’ve looked at the setup as it is for primary domain, however MG suggests configuring a subdomain instead. While it is possible to set the TXT & CNAME records for a subdomain, MX records can not be configured for a subdomain that way. Fortunately there is a (non-obvious) solution - subdomain should be added as a domain in DO panel:
Now we can configure MX records for that subdomain, and while at it…move other records to the subdomain configuration aswell. Keep in mind that now DO appends entire subdomain to TXT & CNAME records: