Introduction to DNS

The Internet addressing is based on IP addresses, these conform the basic addressing scheme of the Internet and they are 32 bit addresses in the case of IPv4 and 128 bits in the case of IPv6. The IPv4 addresses are represented in a notation that consists of the value of each byte separated by dots, following the format xxx.yyy.zzz.ttt (i.e. 192.168.0.1).

This addressing was designed to facilitate the job of routers but, since it requires the memorization of numeric sequences, it's not very manageable for humans. The solution for this problem was to give names to computers.

Initially the correlation between names and IP addresses was done using the hosts file that contained the database of names and IP addresses, that file was managed centrally and distributed regularly to all the systems in the network. When the network started to grow it became obvious that this system would not escalate and the decision was made to move the naming service to a hierarchical directory system based in what is known as domain names.

For the DNS it was decided to create a hierarchical structure that matched the organizational structure of the institutions that had systems connected to the Internet, for this reason it was decided that DNS would have a hierarchical structure of names where the levels of the hierarchy (domains) would be separated by ".". Names like www.example.org are made of a domain, example.org, and a host name, www. The domain name is made of two parts: org, which is the Top Level Domain (TLD), and in the case of .org is managed by the Public Interest Registry (PIR), and example which is the second level domain and represents the organization. Second level domains can have delegations called subdomains.

In the DNS each domain is managed by the controlling institution, so there isn't a centralized database that holds al the DNS information, instead there is a group of servers called root servers that hold the information of what servers hold the Top Level Domains (TLDs) and these hold the information about which servers manage second level domains and the same with subdomains. The servers also hold information about the hosts, mail servers and authoritative DNS servers for the domain.

Because of this structure, searches start at the root servers, following the domain structure until they arrive to the domain that contains the host name or the requested information. Some servers are configured to do recursive searches, this makes possible for a client to launch a query to that server and the it's the recursive server that travels the tree searching the information and then sends the answer the client. This server is allowed to cache the answer for a period of time specified by the client.

An example of the tree structure of DNS would be the following:

DNS structure diagram

In this diagram you can see that the root servers point to the TLDs and the TLDs to the second level domains, second level domains have both hosts and submains.