- dns 2017-03-19T16:58:15+01:00 https://fadeit.dk/blog/tag/dns.html Digital Ocean DNS setup for Mailgun 2015-11-03T11:22:30+01:00 https://fadeit.dk/blog /2015/11/03/mailgun-dns-setup-digital-ocean <p>When setting up Mailgun (MG) &amp; Digital Ocean (DO) I ran into unexpected complications. Unfortunately DNS configuration feedback l<font size="4" style="position:relative; top:2px;">&infin;</font>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.</p> <p>So the first gotcha with DO is that the domain name is automatically added to the DNS records, therefore if MG setting says <code class="highlighter-rouge">email.fadeit.dk</code>, then that means only <code class="highlighter-rouge">email</code> should be entered in DO:</p> <p><img src="/blog/assets/mailgun-dns-setup-digital-ocean/cname.jpg" alt="Domain is automatically appended" /></p> <p>Second gotcha requires us to wrap TXT record value in quotes:</p> <p><img src="/blog/assets/mailgun-dns-setup-digital-ocean/quotes.jpg" alt="TXT records need to be wrapped in quotes" /></p> <p>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 &amp; 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:</p> <p><img src="/blog/assets/mailgun-dns-setup-digital-ocean/subdomain.jpg" alt="Subdomain should be added as a domain" /></p> <p>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 &amp; CNAME records:</p> <p><img src="/blog/assets/mailgun-dns-setup-digital-ocean/conf.jpg" alt="Subdomain should be added as a domain" /></p>