Utf-8在子域?

Flu*_*ffy 5 subdomain dns utf-8 idn

是否可以在子域中使用UTF-8?如果是这样,允许哪些字符以及无法混合编码的工作原理如何?

我试过RTFM,但谷歌没有多大帮助

ysd*_*sdx 4

子域没有什么特别的。给定的域名是标签 ( , , )foo.example.com的有序列表。因此您可能想知道是否可以在给定标签中使用 UTF-8。fooexamplecom

低级答案是标签定义为:

<label> ::= <letter> [ [ <ldh-str> ] <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
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
Run Code Online (Sandbox Code Playgroud)

这意味着您只能[-a-zA-Z0-9]在标签中找到。

但是,IDNA可用于对 Unicode 字符进行编码。简而言之,包含其他字符的标签用: 进行编码"xn--" + punycode(nameprep(label))

至于限制至少:

  • for 字符不能出现在 IDN 标签中(U+002E、U+3002、U+FF0E、U+FF61)。