delphij's Chaos

选择chaos这个词是因为~~实在很难找到一个更合适的词来形容这儿了……

14 Feb 2008

域名中不应出现下划线

目前我知道国内有至少两家主要的互联网公司用了这样的域名,不知道他们用的是什么域名服务器,至少 BIND 9 是不支持这样做的。

RFC 952 - 美国国防部互联网主机表规范中的相关条文如下:

  1. A “name” (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.). Note that periods are only allowed when they serve to delimit components of “domain style names”. (See RFC-921, “Domain Name System Implementation Schedule”, for background). No blank or space characters are permitted as part of a name. No distinction is made between upper and lower case. The first character must be an alpha character. The last character must not be a minus sign or period. A host which serves as a GATEWAY should have “-GATEWAY” or “-GW” as part of its name. Hosts which do not serve as Internet gateways should not use “-GATEWAY” and “-GW” as part of their names. A host which is a TAC should have “-TAC” as the last part of its host name, if it is a DoD host. Single character names or nicknames are not allowed.

而成为正式 Internet 规范 STD 13 的 RFC 1034 则如此建议(Section 3.5 Preferred name syntax):

The following syntax will result in fewer problems with many applications that use domain names (e.g., mail, TELNET).
::= | " "

::= | “.”

::= [ [ ] ]

::= |

::= | “-”

::= |

::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case

::= any one of the ten digits 0 through 9

因此,在域名的主机名称中出现 _ 是不规范的,这个字符不应出现在 A RR 中。BIND 9 会明确拒绝这种配置,并且其 resolver 也会拒绝接受这类域名。在使用中,应尽量避免这种情况。


Archived: 2 Comments

atppp | February 14, 2008 5:14 AM

早期有人用下划线域名曾经出现过世界范围的 DNS 混乱,现在应该不会出大问题了,不过还是尽量避免为好。水木有个版面域名叫 版名.board.newsmth.net,碰到有下划线的版名 lighttpd 直接拒绝跳转,而原来用 apache 跳转的时候还是允许的,看来 apache 比较仁慈一点。。

Xin LI | February 14, 2008 5:57 AM

拜 atppp!