RFC 1738:URL:主机是否必须包含点?

时间:2011-08-18 15:28:37

标签: url host rfc

根据RFC 1738: Uniform Resource Locators (URL): 3.1. Common Internet Scheme Syntax,主机组件是否必须包含一个点,例如“example.com”?即,它可能只由一个域名标签组成吗?

1 个答案:

答案 0 :(得分:2)

不,主机不必包含点。即,是的,只有一个域名标签可以。查看domainsubdomainlabelhttp://tools.ietf.org/html/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

本文档引用http://tools.ietf.org/html/rfc1738#section-3.1来描述主机命名规则。