DNS is an example of a distributed, hierarchical database. Thus, the information in the DNS database is spread out among many different machines across the Internet. The purpose of this database is to manage the relationship between the DNS namespace (the collection of possible names for machines) and IP addresses. The namespace for DNS is organized into a tree, or hierarchical structure, of domains
Domain names are the most common method used for accessing websites or any other host on the Internet. Each domain name is made
up of a number of elements (called "labels") separated by a dot, (for example: www.cplusoop.com).
The domain name system works in a hierarchical model, with the right most elements classed as the "Top Level Domain" or TLD, followed by
the second element, which is classed as the "Second Level Domain". This structure continues from right to left with each element being classed as a subdomain of the element to its right.
A DNS entity's name is specified by giving its position in this tree of domains and subdomains,
with each subdomain name separated from the next by a period (.). The root domain, which is the root of the entire tree of domains, is named “.” (dot). For example, a machine named www.acmecorp.com belongs to the domain .acmecorp.com, which in turn is a subdomain of the .com domain, which in turn is a subdomain of the root domain (represented by a period).
The (FQDN) Fully Qualified Domain Name of a DNS entity is the full path from the root of the DNS tree to that entity. Because an FQDN always specifies the full path to the entity, it must always end with a period. For example, the FQDN for the machine www.acmecorp.com would be
This terminating period plays the same role in the DNS naming scheme that the leading slash (/) marker plays when specifying the absolute path name of a file in the UNIX filesystem. The difference is that a path name moves from general to specific as we read from left to right, and an FQDN moves from specific to general as we read from left to right. Thus the marker for the root of the tree occurs at the left in a path name, and at the right in an FQDN.
A domain is a distinct piece of the DNS namespace that is managed by a single administrative entity. A domain consists of a root domain, a top-level domain, a second-level domain, and a series of subdomains.
A subdomain is any domain under the authority of another domain. For example, a top-level domain is a subdomain of the root domain, a second-level domain is a subdomain of a top-level domain, and so on.