According to RFC 1738: Uniform Resource Locators (URL): 3.1. Common Internet Scheme Syntax, must the host component contain a dot, e.g., "example.com"? I.e., may it be composed of only one domain label?
Asked
Active
Viewed 1,212 times
1 Answers
2
No, the host doesn't have to contain a dot. I.e., yes, only one domain label is fine. Look at domain
, subdomain
and label
( https://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
This document is referenced from https://www.rfc-editor.org/rfc/rfc1738#section-3.1 to describe the host naming rules.

Community
- 1
- 1

Andrey Agibalov
- 7,624
- 8
- 66
- 111
-
1+1, but maybe you could edit in a link to RFC 1034 Sec 3.5 and an explanation that RFC 1738 references that for host name rules? – Kevin Aug 18 '11 at 15:37
-
Thanks. I saw that. I just didn't understand how to read it (Does the end of the first line mean that `
` can just be a space?). But, now I see that ` – ma11hew28 Aug 18 '11 at 17:00` can just be one `