Names and maximum lengths of the parts of a URL

subdomain, url

Solution

The Wikipedia entry for Subdomain answers both questions:

- What is the name of each part?

A subdomain is a domain that is part of a larger domain; the only domain that is not also a subdomain is the root domain. For example, `west.example.com` and `east.example.com` are subdomains of the `example.com` domain, which in turn is a subdomain of the com top-level domain (TLD). A "subdomain" expresses relative dependence, not absolute dependence: for example, `wikipedia.org` comprises a subdomain of the `org` domain, and `en.wikipedia.org` comprises a subdomain of the domain `wikipedia.org`.

- What is maximum length of each part? e.g. subdomain, domain name, top-level domain…

In theory this subdivision can go down to 127 levels deep, and each DNS label can contain up to 63 characters, as long as the whole domain name does not exceed a total length of 255 characters. But in practice most domain registries limit at 253 characters.

Problem

In this URL: ``` http://www.subdomain.domainname.abc.xyz.com.us/directory/filename.extension ``` - What is the name of each part? - What is maximum length of each part? e.g. subdomain, domain name, top-level domain…

Original source