一个A REC和CNAME的Route53的区别区别、REC、CNAME

2023-09-11 10:43:51 作者:100%无添加纯可爱

随着亚马逊路线53,您可以设置A记录或CNAME使用别名不同的子域名,我想知道什么是A记录,CNAME之间的区别吧。

As Amazon Route 53 allows you to set an A record or a CNAME to a different sub-domain name using Alias, I am wondering what is the difference between A record and CNAME now.

要澄清我的问题,CNAME和传统的名称服务器的记录之间的区别是,只有CNAME可以用来指向一个不同的子域,A记录必须指向一个有效的IP地址。由于AWS Route53允许你做使用子站点为A拍摄或CNAME ..它不能模糊两者之间的区别。

To clarify my question, the difference between CNAME and A record in a traditional NameServer is that only CNAME can be used to point to a different subdomain and A record must point to a valid IP address. Since the AWS Route53 allows you to do use a subdomain with either A Rec or CNAME .. does it not blur the distinction between the two.

推荐答案

您的问题是相当有效的,但你使用这个词在未quite- precise方式子域。

Your question is quite valid, but you are using the word "subdomain" in a not-quite-precise way.

什么你实际上问的是有关的事实,一个路线53, A 记录可以给其他域里引用的完全限定主机的外观,或从它自己的域名主机名或子域,而在正确的DNS,引用另一个主机名的唯一方法是使用 CNAME ,但这些不能在顶点供应一个域名(example.com),指向一个子域(www.example.com)。

What you are actually asking is about the fact that an Route 53, an A record can give the appearance of referencing either a fully-qualified hostname from another domain, or a hostname or subdomain from its own domain, while in proper DNS, the only way to reference another hostname is with a CNAME, yet those can't be provisioned at the apex of a domain ("example.com") pointing to a subdomain ("www.example.com").

这是别名,你说,似乎是功能上等同,但比更灵活 CNAME 等是有区别吗?

An alias, you're saying, seems to be functionally equivalent but more flexible than a CNAME so is there a difference?

一之间的差异 CNAME 和一个别名是一个 CNAME 仍然是一个正确的,标准的,普通的DNS CNAME ,它会返回一个DNS查询响应你需要知道的真正的( C anonical )名称您正在寻找的服务器是'X'等,视情况而定,可能还包括 A 记录目标主机也可以不要求客户去一个第二查找

The difference between a CNAME and an alias is that a CNAME is still a proper, standard, ordinary DNS CNAME, which returns a DNS query response " you need to know that the real ("canonical") name of the server you are looking for is 'x'" and, depending on circumstances, may also include the A record for the target host or may not, requiring the client to go for a second lookup.

别名,在另一方面,亚马逊创造了一个聪明的黑客攻击不破该协议还允许路53直接把手伸到 A 记录从资源 X当 A 记录资源的请求Y。别名也可以参考其他记录类型,但它们引用的记录类型必须相同,本次讨论的目的,我说的是 A 记录的别名。

Aliases, on the other hand, are a clever hack created by Amazon which does not break the protocol yet allows Route 53 to hand out the A record directly from resource "X" when the A record for resource "Y" is requested. Aliases can also reference other record types, but the record type they reference must be the same and for the purposes of this discussion, I am talking about A record aliases.

和,重要的外卖这里是一个别名实际上返回一个 A 记录 - 而不是一个参考目标,就像一个 CNAME 一样。

And, the important take-away here is that an alias actually returns an A record -- not a reference to the target, like a CNAME does.

美中不足的是,有一个别名,你不能把刚才的任何主机名在该框中。它必须是一个域,路由53具有神奇的钩子,以便它可以检索适当方面 A 记录来提供在一个主机 - 无论是在您的区域另一个项目,或者从S3,ELB,或的Cloudfront。这是一个非常不同的实施比 CNAME 记录是如何工作的,即使净效应似乎是相同的。

The catch is that with an alias, you cannot put just any hostname in that box. It has to be a hostname within a domain where Route 53 has the magical hooks so that it can retrieve the apprpriate A record to serve up -- either another entry in your zone, or from S3, ELB, or Cloudfront. This is a very different implementation than how CNAME records work, even though the net effect appears to be the same.

把其他东西放在那儿,和的记录集无法保存,因为: - 别名目标包含无效值试试吧。 :)

Put anything else in there, and The record set could not be saved because:- Alias Target contains an invalid value. Try it. :)

当然, CNAME 记载有这样的没有限制......他们只是在一个区域的顶部受限于设计中的使用。

Of course, CNAME records have no limitation like that... they're just limited by design in their use at the top of a zone.

所以,其实,别名和 CNAME 记录没有你可能已经起初以为尽可能多的重叠。在某些情况下,只有一个是可用的,和的情况下任一个将工作,所不同的是可能微不足道。

So, in fact, Aliases and CNAME records do not have as much overlap as you may have initially thought. In some situations, only one is usable, and cases where either one would work, the difference is probably insignificant.

别名在任一个可以使用的情况下的一个优点是,一个别名从未要求2的DNS查询,如我在上面提到。它总是直接回答路线53与相应的 A 的记录,其中 CNAME ,至少在情况下,它引用一个主机名在不同的顶级域名,可能需要两个连续的DNS查找,从而别名在这种情况下的理论性能上的优势。

One advantage of Alias in the case where either one could be used is that an alias never requires 2 DNS queries, as I mentioned above. It is always answered directly by Route 53 with the appropriate A record, where a CNAME, at least in the case where it references a hostname in a different top level domain, can require two sequential DNS lookups, giving Alias a theoretical performance advantage in that case.