部署 Heroku cname 绑定根域名时和 MX 邮箱的设置相冲突

yune · 2015年08月12日 · 最后由 yune 回复于 2015年08月14日 · 6235 次阅读

heroku 绑定域名时只能是 cname,没有 ip,子域名没问题。 但是根域名被邮箱的设置 MX 用掉了,所以不能再用 cname 域名是万网的,看说明还有‘显性 URL’和‘隐形 URL’2 个可以用,但是都要求是备案过的域名,国外的网站又不能备案(或者很麻烦) 官网上说 还可以用 ALIAS/ANAME 这 2 个东西,但是万网没这 2 个东西 https://devcenter.heroku.com/articles/custom-domains

Configuring DNS for root domains

Configuring your DNS provider for a root domain is similar to configuring a DNS provider for a subdomain. However, whereas with subdomains the type of record to configure is always a CNAME, with root domains the type of record depends on the DNS provider:

Whichever provider you have, point the ALIAS/ANAME/CNAME entry for your root domain to the DNS Target, just as you would with a CNAME record:

除了备案 和 不用 heroku 还有没有其他省事的解决方案?

谢谢大家!

有一个服务叫做 DNSPOD

  1. DNS 换到 dnspod.cn
  2. 显示 URL 这个不能解决你的需求,这是实现 URL Redirect 的;
  3. 能 CNAME 和 MX 共存的,Ruby China 的域名就有这么配置;

#2 楼 @huacnlee 1.换 DNS 有什么用? 2.可能不同的域名提供商不一样,我这边 CNAME 和 MX 不能共存,用的万网(阿里)

出错啦! CNAME 记录与主机记录(@)的 MX 记录冲突,无法保存成功。 了解解析记录冲突规则

换了 DNS 服务商就有了

1.DNSPOD 这个网站上添加 根域名 CNAME 解析,提示说会影响收发邮件

2.万网换 DNS 服务器(万网上因为 MX 的原因不让添加根域名 CNAME 不能添加)

3.

4.$ host hellocareer.cn hellocareer.cn has address 207.36.47.9 hellocareer.cn mail is handled by 1 mx01.ufhost.com. hellocareer.cn mail is handled by 1 mx01.euchost.com. (还是跑到 MX 邮件那边去了)

时间已经过了 2 个多小时 根域名 hellocareer.cn 依然不能访问 @huacnlee @miclle rubychina 上也是这么用的吗?对这块原理陌生,可能弄错了,能不能帮我看看,感激不尽。

上海电信表示可以访问 hellocareer.cn 了

#6 楼 @miclle 嗯 我也可以了。大长城可能是慢一些。邮件也没被影响。谢谢大家

mx 记录的优先级较低,如果裸域名直接 cname,发件方不指定获取 mx 的话,就 follow cname 之后的记录了,所以通常不建议在有 mx 记录存在的情况下裸域名设置 cname

CNAME 生效之后应该就会开始丢邮件了

#9 楼 @doitian @acaby 暂时还没听到抱怨丢邮件。也不知道其他办法。先这样了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号