[RFC1035]定义<domain-name>
为
<domain-name> is a domain name represented as a series of labels, and
terminated by a label with zero length.
这意味着必须是以“ ”结尾的<domain-name>
FQDN 。此外,根据此 RFC,CNAME 和 MX EXCHANGE RDATA 必须是。an.example.
.
<domain-name>
根据维基百科[维基百科] 区域文件可能包含相关条目,例如
wwwtest IN CNAME www
我也用过几次。那么,谁错了?
答案1
是的。BIND 区域文件中的非规范化主机名会自动使用相关域名进行限定。当您写入
wwwtest IN CNAME www
在 的区域文件中example.com
,BIND 会在不询问您的情况下将规范名称转换为www.example.com
。
众所周知,这会导致系统管理员在区域文件中放入条目,例如,example.com
内容如下
www IN CNAME hosting-server.isp.example.co.uk
然后当他们的客户抱怨浏览器不断返回时,他们感到非常惊讶主机名hosting-server.isp.example.co.uk.example.com未找到错误。
答案2
是的。实际答案是,我的<domain-name>
仅对 RFC 第 3 节有效。第 5 节第 34 页<domain-name>
针对主文件(区域文件)进行了定义:
<domain-name>s make up a large share of the data in the master file.
The labels in the domain name are expressed as character strings and
separated by dots. Quoting conventions allow arbitrary characters to be
stored in domain names. Domain names that end in a dot are called
absolute, and are taken as complete. Domain names which do not end in a
dot are called relative; the actual domain name is the concatenation of
the relative part with an origin specified in a $ORIGIN, $INCLUDE, or as
an argument to the master file loading routine. A relative name is an
error when no origin is available.