根域名 CNAME 且不存在 MX 记录,是否会有其它副作用?

2016-10-03 04:11:38 +08:00
 abelyao
例如:
example.com -> CNAME 记录
www.example.com -> A 记录
foo.example.com -> A 记录

整个域名不存在 MX 记录,是否还有其它副作用?
4605 次点击
所在节点    问与答
22 条回复
seki
2016-10-03 04:39:36 +08:00
如果你没有什么具体的目的的话,没有。
DesignerSkyline
2016-10-03 05:52:44 +08:00
CNAME Flattening
ZE3kr
2016-10-03 06:51:03 +08:00
其实根域名上肯定还有 SOA 和 NS 记录,理论上还会影响这两个,尤其是在已经有 CNAME 缓存的情况下
jasontse
2016-10-03 08:53:58 +08:00
RFC 不允许与任何记录共存

A CNAME record is not allowed to coexist with any other data. In
other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you
can't also have an MX record for suzy.podunk.edu, or an A record, or
even a TXT record. Especially do not try to combine CNAMEs and NS
nanjishidu
2016-10-03 10:29:21 +08:00
mx 是和邮件相关的记录类型。。。一个域名有 cname 还有 A 记录 这种情况下 你想让这个域名走哪个呢
abelyao
2016-10-03 11:47:11 +08:00
@ZE3kr @jasontse
那像 阿里云弹性 Web 、新浪云 SAE 、七牛、又拍云,都是只提供了 CNAME 绑定的方式,那就不能直接用 example.com 咯?有什么方法吗?
ZE3kr
2016-10-03 12:00:21 +08:00
@abelyao 见 L2
abelyao
2016-10-03 12:59:58 +08:00
@ZE3kr 最终还是妥协了,用个单字母的子域 cname 到又拍云
initpub
2016-10-03 13:19:38 +08:00
@DesignerSkyline 这是最好的,不过楼主貌似只做“域名->IP ”,那么答案是没有任何副作用。
Showfom
2016-10-03 13:47:29 +08:00
用 cloudxns 的 link 记录即可代替
DesignerSkyline
2016-10-03 14:20:37 +08:00
@initpub 对啊对啊, ANAME 也行
abelyao
2016-10-03 14:21:24 +08:00
@Showfom CloudXns 的 Link 是要求目标地址也使用 CloudXns 吧?
abelyao
2016-10-03 14:26:13 +08:00
@initpub 真的吗,裸域 cname 到另一个域名,可以的?
msg7086
2016-10-03 14:56:34 +08:00
CNAME 相当于给域名做别名。
也就意味着源域名上的解析记录都会跟着目标域名走。
initpub
2016-10-03 16:57:50 +08:00
@abelyao 这方面 CloudFlare 做出了很清楚的说明(就是这帮人折腾出了“ CNAME Flattening ”):

https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/

“ Technically, the root could be a CNAME but the RFCs state that once a record has a CNAME it can't have any other entries associated with it: that's a problem for a root record like example.com because it will often have an MX record (so email gets delivered), an NS record (to find out which nameserver handles the zone) and an SOA record.”

裸域可以用 CNAME ,主要代价是失去 MX 记录(电子邮件,反正你不用哈), NS 记录(下面再接着说), SOA 记录。

裸域的 NS 记录:

https://blog.dnsimple.com/2015/04/common-dns-records/

“ The benefit of having multiple NS records on the apex zone is additional redundancy of DNS service.”

因为你域名的注册商那里,就可以设置域名解析服务器,所以此处 NS 记录是“冗余”( redundancy )。

我也是以前遇到过类似问题,自己不是专业系统管理员啦,欢迎拍砖 :-)
abelyao
2016-10-03 17:36:35 +08:00
@initpub 那是一定要用 CloudFlare 的 CNAME Flattening 才可以嘛?还是 DNSPod 之类的也行?
initpub
2016-10-03 18:53:32 +08:00
@abelyao DNSPod 我不熟耶 :-(
abelyao
2016-10-03 19:06:54 +08:00
@initpub 普通的 cname 可以吗
su8610
2016-10-03 19:09:34 +08:00
MX 是用来解析邮件地址的,如果没这需求可以不要
initpub
2016-10-03 19:16:58 +08:00
@abelyao 这个事最好的办法就是随便用个域名测试一下—— example.com CNAME www.qq.coma.example.com A 8.8.8.8 ,然后等一段时间,用网上的 DNS 工具看看解析是否正常。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/310339

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX