To understand the domain name structure you really need to understand the problem the structure was meant to solve.
The Domain Name Structure and Domain Name System were developed to organise and find the IP addresses of Computers on large distributed networks.
Before the domain name structure was developed computer names and IP addresses were mapped using a flat list and stored in a simple text file called the hosts file.
This file was maintained separately by each user on their own computer.
This mapping looked like this:
This kind of structure works well for a small number of machines on a small local network, but doesn’t’ work well when you have lots of machines spread over different networks.
Lets take an example of two networks with two different administrators who have been responsible for assigning names and IP addresses on their own networks.
Lets assume that each network has a mail server, and each administrator has created a hosts file for all of their network users.
The hosts file for network 1 might look like this:
and the host file for network 2 might look like this
As you can see both administrators have chosen the same name but the mail servers are on different machines.
If we were now to connect these two networks together and create a single host file for the combined network we would have to rename one or both of the mail servers.
So our new hosts file would look like this:
The situation described above is easily manageable with just two networks, and two mail servers, but is not so easy when we have thousands of servers and networks joined together.
To solve this problem we need to give the machine names some type of structure, so that even if the administrators of each network were to choose the same names, it wouldn’t matter.
We could use the network names as part of the naming structure so we could have:
mailserver in Network 1 and mailserver in Network 2
and this is indeed what we do, but instead of networks we use the term domain.
Wiki defines a domain as follows:
A domain name is an identification string that defines a realm of administrative autonomy, authority or control within the Internet.
So now we have
mailserver in Domain 1 and mailserver in Domain 2
This arrangement is much better than the original flat list but again gives us problems as the number of domains increases. The solution is to arrange the domains in a hierarchy.
This takes the form of a tree like structure that resembles the file system structure found on computers.
On your computer the top of your file system is usually c:\ (windows) or / (linux).
On a file system the files are placed in folders or directories, and the directories can contain other directories.
In the Domain Name structure computer IP address mappings (equivalent to files) are placed in domains, and these domains can contain other domains (sub domains).
The root of the structure is a dot (.).
In the file system naming is done from the root down, but in the domain name system it is done from the bottom to the root.
So we have C:\folder\subfolder\file for the filesystem path, and computername.subdomain.domain. for DNS.
In the file ssytem structure a \ or / is used as the separator, wheres in DNS a dot is used.
Underneath the top level dot (root) are what are known as the top level domains (TLDs) which are strictly controlled (e.g..com, .net, .UK).
These country specific TLDs were added later when the Internet became International.
Underneath the top level domains are second level domains like IBM,Microsoft and Juice in our example below.
This second level name is typically the name of an organisation, and control over this name is given to that organisation.
The organisation can then divide the domain into third level domains as it wishes.
At any level a domain can contain sub domains or computer name to address mappings (i.e. www).
What is WWW?
You may have noticed that most websites have a web address of the form www.domainname.com.
The www name is the name of the web server, and it is a convention on the internet so as to make it easier for you to remember Web addresses.
Because people remember names easier than numbers computers names are used instead of numbers (IP addresses).
Originally this mapping was done manually and then using a simple text file on the computer but as networks and network sizes increased there was a need for a better way of organising these name to IP address mappings.
The resulted in the development of the Domain name Structure and the Domain Name System.
Related Tutorials and resources:
- Understanding DNS- for Beginners
- DNS Zones and Zone Files Explained
- DNS Lookups Explained
- Host Name Resolution explained
- Dynamic DNS Explained