Any given domain name has three primary parts.
The last part of a domain name, is know as the TLD or top level domain. [.com]
There are only a certain restricted number of defined TLDs available although the number has been growing a lot in recent years.
Common TLDs. .com, .edu, .net, .CN, .DE
Due to the growth of the internet,many of the TLDs originally defined have become very crowded. So today, a number of vanity TLDs are available, everything from dot museum to dot pizza.
The Internet Corporation for Assigned Names and Numbers
Is a sister organization to the IANA, and together they helped define and control both the global IP spaces along with the global DNS system.
A domain is the name commonly used to refer to the second part of a domain name [Google]
Domains are used to demarcate where control moves from a TLD name server, to an authoritative name server. This is typically under the control of an independent organization or someone outside of ICANN
Domains can be registered and chosen by any individual or company, but they must all end in one of the predefined TLDs.
Www portion is known as the sub domain. Sometimes referred to as a host name if its been assigned to only one host
While it costs money to officially register a domain with a registrar, sub domains, can be freely chosen and assigned by anyone who controls such a registered domain.
A registrar is just a company that has an agreement with ICANN to sell unregistered domain names.
DNS can technically support up to 127 level of domain in total, for a single fully qualified domain name.
There are some other restrictions in place, for how a domain name can be specified. Each individual section can only be 63 characters long, and a complete FQDN is limited to a total of 255 characters.