[1] LDH ラベルは、 DNS において、 letter、 数字、ハイフンで構成されるラベルのことを言います (より厳密には >>8)。 元々は単に「ラベル」とも呼ばれていましたが、 IDN におけるラベルは非ASCII文字に拡張されているため、 IDNA2008 では 「LDHラベル」という語を導入しています。
[3] これは元をたどれば RFC 952 で「ホスト名」 と言っていたものに近いです >>2 が、若干の違いがあります (>>14)。 あるいは RFC 1034 の3.5節で「好ましい名前の構文」 と言われていたものを RFC 1123 で変更したものと構文的に同じです >>2。
[21] LDHラベルは、定義上「-
」から始めたり終わったりすることができません。
しかし、現実にはそのようなラベルを使ったドメイン名が存在します。
[22] Bug 196852 – URLs starting with hyphen ( - ) not resolved ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=196852
[23] >>22 によれば、 Windows の resolver はこれに対応しているものの、 Linux の resolver は対応していないようです。
[26] LDHラベルは、定義上「_
」を含めることができません。
しかし、現実にはそのようなラベルを使ったドメイン名が存在します。
[25] ホスト名に _
を含める困った無料鯖, Tripod 以外にもあるらしい。
[24] >>1 このままなし崩し的に _
も名前文字に仲間入りするのかなあ?
[32] Webブラウザーによっては _
が含まれるドメインで
Cookie を正しく扱えないようです。
[28] _
は「好ましい」構文には含まれていませんが、 DNS
仕様上特に禁じられているわけではありません。
[29] RFC 3986 は URI の host として使える名前を特に DNS
に限定しておらず、構文上 _
やその他の記号を禁じていません。
[30] RFC 2616 は旧仕様である RFC 2396 を参照しており、
http:
URL の host 部分や Host:
頭欄の値として RFC 2396 の host、すなわち「好ましい」構文による DNS
名を求めているため、 _
は禁止されています。
[31] RFC 6265 は Set-Cookie:
頭欄の Domain
属性が従わなければならない構文として「好ましい」構文を使っているため、
_
は禁止されています。しかし解釈する側においては、仕様書の解釈しだいでは
_
を受け入れることも禁止されていないと読めます。
[19] IDNA で正しいとされるのは NR-LDHラベルと、 R-LDHラベルのうち Aラベルだけです。 (他に Uラベルもありますが、 Uラベルは LDHラベルではありません。) XNラベルではないR-LDHラベルや偽Aラベルは正しくないラベルということになります。
[12] 以前は先頭1文字が DIGIT
であることも認められていませんでしたが、
RFC 1123 で緩和されています。
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.
<hname> ::= <name>*["."<name>] <name> ::= <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>]
<domain> ::= <subdomain> | " " <subdomain> ::= <label> | <subdomain> "." <label> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> <let-dig-hyp> ::= <let-dig> | "-" <let-dig> ::= <letter> | <digit> <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case <digit> ::= any one of the ten digits 0 through 9
The syntax of a legal Internet host name was specified in RFC-952 [DNS:4]. One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit. Host software MUST support this more liberal syntax.
Host software MUST handle host names of up to 63 characters and SHOULD handle host names of up to 255 characters.
[20] LDHラベルでないASCIIラベルを非LDHラベルといいます。
label = (ALPHA / DIGIT) [*61(ALPHA / DIGIT / HYPHEN) (ALPHA / DIGIT)]
ALPHA = %x41-5A / %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT = %x30-39 ; "0"-"9"
HYPHEN = %x2D ; hyphen ("-")
The confusion was thus left as to whether the "preferred" name syntax
was a mandatory restriction in DNS, or merely "preferred".
The syntax for domain and host names described in this document MUST
conform to [RFC0952] and [RFC1123]. At the time of this writing, RFC
3490 [RFC3490] describes a standard to use certain ASCII name labels
to represent non-ASCII name labels.
[35] IRC logs: freenode / #whatwg / 20150715 ( 版) http://krijnhoetmer.nl/irc-logs/whatwg/20150715
[36] Define host equivalence but punt on requirements coming from the cert… · whatwg/url@5e903fe ( 版) https://github.com/whatwg/url/commit/5e903fee4b9a893c8236cf292a0d56a7254ee823
[37] Remove URL.domainToASCII and URL.domainToUnicode · Issue #63 · whatwg/url ( 版) https://github.com/whatwg/url/issues/63
[38] 317946 – Hostnames containing + (plus) do not work in 1.5 (did work in 1.0 and even in IE) ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=317946
[39] 355181 – net_IsValidHostName() comment says one thing, code does another ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=355181
[40] 部屋さがしだけではとどまらぬ。おんなのこ×賃貸物件【Concent不動産】 ( 版) http://concent--e.jp/
Host name: This term and its equivalent, "hostname", have been
widely used but are not defined in [RFC1034], [RFC1035],
[RFC1123], or [RFC2181]. The DNS was originally deployed into the
Host Tables environment as outlined in [RFC952], and it is likely
that the term followed informally from the definition there. Over
time, the definition seems to have shifted. "Host name" is often
meant to be a domain name that follows the rules in Section 3.5 of
[RFC1034], the "preferred name syntax". Note that any label in a
domain name can contain any octet value; hostnames are generally
considered to be domain names where every label follows the rules
in the "preferred name syntax", with the amendment that labels can
start with ASCII digits (this amendment comes from Section 2.1 of
[RFC1123]).
People also sometimes use the term hostname to refer to just the
first label of an FQDN, such as "printer" in
"printer.admin.example.com". (Sometimes this is formalized in
Hoffman, et al. Informational [Page 4]
page-5
RFC 7719 DNS Terminology December 2015
configuration in operating systems.) In addition, people
sometimes use this term to describe any name that refers to a
machine, and those might include labels that do not conform to the
"preferred name syntax".
[43] 名古屋のデザイナーズマンション・高級賃貸なら【スタイルプラス】 ( ()) http://www.style--plus.jp/
Hostnames MUST conform to the Domain Name System (DNS) syntax
defined in [RFC1034] and [RFC1123]. Internationalized Domain
Names (IDNs) must first be transformed to the A-label form
[RFC5890] as per [RFC5891].
[45] RFC 8117 - Current Hostname Practice Considered Harmful () https://tools.ietf.org/html/rfc8117
[46] 1184059 - compatibility issues with domain labels beginning or ending with hyphens, https://bugzilla.mozilla.org/show_bug.cgi?id=1184059
[47] Trailing '-' are wire-encoded in DNS, despite being invalid for hostnames [40681681] - Chromium, https://issues.chromium.org/issues/40681681
_
」は下線ラベルという別の概念に使われています。