httprfc3986

HTTP request host value syntax in RFC 3986


RFC 3986 says that Host (I'm writing with a capital, to distinguish it as parameter inside HTTP request) value reg-name has ABNF syntax reg-name = *( unreserved / pct-encoded / sub-delims ), which includes i.e. signs + or !, which as far as I know are prohibited in URL authority. Standard states also that

A host identified by a registered name is a sequence of characters usually intended for lookup within a locally defined host or service name registry, though the URI's scheme-specific semantics may require that a specific registry (or fixed name table) be used instead. The most common name registry mechanism is the Domain Name System (DNS).

And refers to RFC 1034 section 3.5, where syntax looks more like I would expect. What's the relation between reg-name in HTTP Host value and DNS name syntax? What are technologies which uses HTTP request Host value different than the most common one (which I understand is just one of many others)?


Solution

  • When HTTP was first created, there were many different network technologies in use. So HTTP was originally written to be transport protocol agnostic. By the mid 1990’s TCP/IPv4 became the only used network technology, together with other protocols used on the internet, like DNS. So HTTP was most likely not developed with expecting only DNS to provide some sort of hostname database, and it’s possible that the HTTP standard accepts a broader range of valid hostnames than the DNS protocol.

    To actually answer your question: There is probably no direct relationship. But today there is a de-facto relationship that you'll see only valid DNS names as HTTP Host names on the internet.