Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RFC 1738: URL: Must the host contain a dot?

Tags:

url

host

rfc

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?

like image 471
ma11hew28 Avatar asked Nov 04 '22 16:11

ma11hew28


1 Answers

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.

like image 168
Andrey Agibalov Avatar answered Nov 10 '22 00:11

Andrey Agibalov