5

根据RFC 1738:统一资源定位符 (URL):3.1。通用 Internet 方案语法,主机组件是否必须包含一个点,例如“example.com”?即,它可以仅由一个域标签组成吗?

4

1 回答 1

2

不,主机不必包含点。即,是的,只有一个域标签是可以的。看domainsubdomainlabelhttps://www.rfc-editor.org/rfc/rfc1034#section-3.5):

<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

本文档引用自https://www.rfc-editor.org/rfc/rfc1738#section-3.1描述主机命名规则。

于 2011-08-18T15:31:30.197 回答