Chinaunix首页 | 论坛 | 博客
  • 博客访问: 926593
  • 博文数量: 146
  • 博客积分: 3321
  • 博客等级: 中校
  • 技术积分: 1523
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-29 10:32
文章分类

全部博文(146)

文章存档

2014年(2)

2013年(5)

2012年(4)

2011年(6)

2010年(30)

2009年(75)

2008年(24)

分类: 系统运维

2010-08-12 09:47:54

这是RFC 1034中关于Aliases的解释。自己看的时候简单翻译了一下,水平有限,自己能理解就行了。

3.6.2. Aliases and canonical names(别名和正规名)

In existing systems, hosts and other resources often have several names that identify the same resource. For example, the names C.ISI.EDU and USC-ISIC.ARPA both identify the same host. Similarly, in the case of mailboxes, many organizations provide many names that actually go to the same mailbox; for example Mockapetris@C.ISI.EDU, Mockapetris@B.ISI.EDU, and PVM@ISI.EDU all go to the same mailbox (although the mechanism behind this is somewhat complicated).

    在当前的系统中,主机和其他资源往往会通过很多名字来指向相同的资源。比如,C.ISI.EDUUSC-ISIC.ARPA都是标识了同一台主机。同样的在邮箱这边,许多组织提供了很多邮箱名,实际上他们最终还是指向了相同的邮箱地址,比如,Mockapetris@C.ISI.EDU,mockapetris@B.ISI.EDU,以及PVM@ISI.EDU都是指向了相同的邮箱(尽管后台的实现原理可能很复杂)。

Most of these systems have a notion that one of the equivalent set of names is the canonical or primary name and all others are aliases.

    很多这种系统都有这样的思想:等价类中的一个名字是真实的正归名字其他的都是别名。

The domain system provides such a feature using the canonical name (CNAME) RR. A CNAME RR identifies its owner name as an alias, and specifies the corresponding canonical name in the RDATA section of the RR. If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.

    域名系统使用CNAME资源记录来提供这种特性。一条CNAME资源记录用一个别名来标识他的所有者的名字,同时在资源数据中指出与别名相对应的正规名。如果一个节点提供了关于CNAME的相关信息,那么他将不再提供其他其他数据,这就确保了正规名的数据和别名的数据是相同的。这种规则同时确保了缓存的CNAME记录可以被直接使用,而不需再向授权域名服务器查询其他类型的资源记录。

CNAME RRs cause special action in DNS software. When a name server fails to find a desired RR in the resource set associated with the domain name, it checks to see if the resource set consists of a CNAME record with a matching class. If so, the name server includes the CNAME record in the response and restarts the query at the domain name specified in the data field of the CNAME record. The one exception to this rule is that queries which match the CNAME type are not restarted.

CNAME的资源记录会引起DNS服务软件的特殊响应。当以个域名服务器没有找到关于查询域名的指定资源记录时,他回去检查这个资源记录中是否包含了与查询相匹配的CNAME资源记录。如果有,这个域名服务器会将CNAME的记录加入响应报文中,同时启动一个关于CNAME资源记录中的查询。这个规则的一个异常是与CNAME类型相匹配的查询没有重新启动。

For example, suppose a name server was processing a query with for USC- ISIC.ARPA, asking for type A information, and had the following resource records:

    USC-ISIC.ARPA   IN      CNAME   C.ISI.EDU

 

    C.ISI.EDU       IN      A       10.0.0.52

 

Both of these RRs would be returned in the response to the type A query, while a type CNAME or * query should return just the CNAME.

比如,假设一个域名服务器正在执行一个关于USC-ISIC.ARPAA记录的查询,同时有如下的资源记录:

USC-ISIC.ARPA   IN      CNAME   C.ISI.EDU

 

C.ISI.EDU       IN      A       10.0.0.52

 

那么这两条记录都会被包含在关于A记录查询的响应报文中,只有当查询类型是CNAME或者*时,他将只包含CNAME的记录。

 

Domain names in RRs which point at another name should always point at the primary name and not the alias. This avoids extra indirections in accessing information. For example, the address to name RR for the above host should be:

   

rather than pointing at USC-ISIC.ARPA. Of course, by the robustness principle, domain software should not fail when presented with CNAME chains or loops; CNAME chains should be followed and CNAME loops signalled as an error.

    域名在资源记录集合中指向的其他名字必须总是主名称,而不能是别名。这样可以避免查询过程中的冗余指向。比如,对于上文中的名字的资源记录应该是:

52.0.0.10.IN-ADDR.ARPA  IN      PTR     C.ISI.EDU

而不是指向USC-ISIC.ARPA.当然基于健壮性,域名软件不能因为出现了诸如此类的多级指向而出错。CNAME链应该可以,但是CNAME循环就要指出其是错误的了。

阅读(3757) | 评论(0) | 转发(0) |
0

上一篇:正则表达式(总结)

下一篇:DNS缓存

给主人留下些什么吧!~~