大网数据广告活动
网站运营与故障问答

Mailgun not finding DNS records on my VPS

· 52CE 我爱测

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 creat…

问题原文

原帖链接 · Dez · CC BY-SA 3.0

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

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。