1

I have been for several weeks trying to set up Mailgun in my VPS (hosted at Site5) by myself because support is not giving any clue about the problem.

I need to set up the DNS records provided by Mailgun for custom domain I created in there:

TXT   mg.mywebsite.com                  v=spf1 include:mailgun.org ~all
TXT   mailo._domainkey.mg.mywebsite.com k=rsa; p=STRING
CNAME email.mg.mywebsite.com            mailgun.org
MX    10    mxa.mailgun.org
MX    10    mxb.mailgun.org

Then I created in my VPS the subdomains needed before adding the DNS records. My VPS is managed through CPanel.

Subdomain               Website folder or redirect
---------               --------------------------
mg.mywebsite.com        http://mailgun.org
email.mg.mywebsite.com  public_html/mg

And then added the DNS records asked by Mailgun in order to work.

email.mg.mywebsite.com.            14400 CNAME mailgun.org
mg.mywebsite.com.                  14400 TXT   v=spf1 include:mailgun.org ~all
mailo._domainkey.mg.mywebsite.com. 14400 TXT   k=rsa; p=STRING
mxa.mailgun.org.                   10    MX
mxb.mailgun.org.                   10    MX

Do I have to change any of my DNS records provided by default by my host in order to Mailgun recognize my configuration?

EDIT 1: Checking with nslookup set querytype=soa example.com I get:

Server:     80.58.61.250
Address:    80.58.61.250#53

Non-authoritative answer:
example.com
    origin = dns.site5.com
    mail addr = root.localhost.localdomain
    serial = 2016090502
    refresh = 3600
    retry = 7200
    expire = 1209600
    minimum = 86400

Authoritative answers can be found from:
example.com nameserver = dns2.site5.com.
example.com nameserver = dns.site5.com.

At first sight, all that data is right.

The SOA record provided by dig is:

example.com.    86400   IN  SOA dns.site5.com. root.localhost.localdomain. 2016090502 3600 7200 1209600 86400
  • How long have you waited? It can take anywhere from 1-72 hours for DNS to propagate. – closetnoc Oct 6 '16 at 16:08
  • @closetnoc for more than 3 weeks! This afternoon I configured another Mailgun DNS records in Hostgator within 2 minutes. – Dez Oct 6 '16 at 16:10
  • 1
    The next question is, are you creating these DNS records with the domain authority? If not, then any record you create does not count. You should see a SOA (statement of authority) record. You can also do a dig +trace example.com any (working from memory) to see who your SOA is. – closetnoc Oct 6 '16 at 16:13
  • Updated the question with data from your questions. I don't see anything strange. – Dez Oct 6 '16 at 16:57
  • 1
    The question is, knowing who your SOA is, are you editing the DNS there or somewhere else? For example, if the SOA is your registrar and you are editing DNS records on your host DNS, that will not work. You will have to edit your DNS records using your registrar. This is a common mistake. Cheers!! – closetnoc Oct 6 '16 at 17:10
1

It is almost never correct to run a DNS server on a virtual private server and set up your DNS records there.

  • You are required to to enter TWO name servers into the DNS settings at your domain registrar. Unless you have two VPS boxes, you cannot do so.
  • A DNS server opens more ports on your VPS that hackers can use to get in. Unless you have experience running a DNS server and are willing to do the work to keep it secure and up to date, I don't recommend running one yourself.
  • Setting up self hosted DNS is more complicated than setting it up on somebody else's server. If you point your nameserver records to be within your own domain name there is a chicken and egg problem that has to be solved with SOA records. I've always found them to be confusing and error prone.
  • DNS hosting is cheap. Good stand alone DNS hosting is under $2 per month. Many domain registrars offer DNS services for FREE with a domain registration. Many web hosting companies offer DNS services for FREE with web hosting. It sounds like you might be able to use Site5.
  • Maybe I didn't express myself well, but I wasn't creating a new DNS server, just used the CPanel tool Advanced DNS zones editor to add the DNS records provided by Mailgun in order to send all transactional mail through their service. – Dez Oct 8 '16 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.