问题
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…
回答1:
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
andeast.example.com
are subdomains of theexample.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 theorg
domain, anden.wikipedia.org
comprises a subdomain of the domainwikipedia.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.
回答2:
To answer question 1:
A simple URI would look something like:
http://www.mywebsite.com
It's easier to explain right to left:
- com is the top level domain (TLD)
- mywebsite is the domain, but would typically include the TLD when describing, e.g. mywebsite.com
- www is a subdomain
- http:// is the protocol used to access the resource
Just to make things a little more confusing, many top level domains are actually 2 domains, such as .co.uk
So, another example would be:
https://aaa.bbb.ccc.mywebsite.co.uk
- co.uk is the TLD
- mywebsite is the domain
- ccc is a subdomain
- bbb is a sub-subdomain, or you could say a subdomain of ccc.mywebsite.co.uk
- aaa is a sub-sub-subdomain, or you could say a subdomain of bbb.ccc.mywebsite.co.uk
Anything after the TLD but before the filename is called the path, e.g:
https://www.mywebsite.com/this/is/a/path/to/resource/filename.txt
In the above example filename.txt is usually called a resource (although some would say the whole line is the resource, because you don't always have a filename).
来源:https://stackoverflow.com/questions/10552665/names-and-maximum-lengths-of-the-parts-of-a-url