Domain Name System (DNS) Architecture

Submitted by damar on Fri, 06/16/2017 - 19:13

Damar Thapa


Legal Notice

Copyright © 2017 | DT's Den |
Disclaimer: I provide no warranty of any kind, express or implied, that the information provided is complete, accurate, and reliable. So, you use the information at your own risk.


Domain Name System (DNS) is an essential part of the Internet. In this article, I will cover the introduction of DNS, its importance on the Internet, its working mechanism, and a basic setup procedure using BIND, an Open Source DNS implementation software system

1. Introduction

The Domain Name System (DNS) is the Internet's hierarchical, distributed database system that translates the Internet's Internet Protocol (IP) addresses to Domain names, and vice versa.
Every computer, a server or client, participating in the Internet activities, providing or receiving services, must have a unique IP address. An IP address serves the Internet for the same purpose as a telephone number does for the telephone network. We know every caller or receiver in the telephone network system must have a unique telephone number.
There are two versions of IP addresses, namely Internet Protocol Version 4 (IP4) and Internet Protocol Version 6 (IP6).
The IP4 addresses are 32-bit in length represented by 4 sets of decimal numbers, ranging from 0 - 255 (28), and separated by periods (.).
Some IP4 example addresses:
The IP6 addresses are 128 bit in length represented by 8 sets of four-digit (16 bits long)hexadecimal numbers, ranging from 0 to FFFF (216), and separated by a colon (:).
Some IP6 example addresses:
The above-explained IP addresses, IP4 or IP6, are perfectly fine for computer systems, but we (humans) are not comfortable with numbers - we are better in words and sentences with meaning. So, instead of using the IP addresses, we use terms, like,,, etc. for our convenience. These terms are computers' Fully Qualified Domain Names (FQDN), or simply Domain names.
An FQDN uniquely identifies a host (computer, server, mobile device, etc.) on the Internet. I will provide further details in subsequent sections.
Using domain names, instead of using IP addresses, makes perfect sense, but these names have to be resolved into real IP addresses for computer and network systems. The DNS is responsible for this task.
As a rough analogy, the DNS is like a telephone book/directory (yellow pages) for the Internet. To understand the role of the DNS, let's see how a user, say John, accesses the hostname, say The following things (not going into full detail/complete technicality) occur during the process:
  • John opens his browser (Firefox, Safari, Internet Explorer, Google Chrome, etc) in his computer, types '' in the address bar, and press 'Enter' to send his request.
  • The browser asks its designated DNS for the IP address of ''.
  • The designated DNS checks its database.
    • If it has the IP address of the requested host, it replies back to the browser.
    • If not, it forwards the request to the external DNS for answer. When it gets the answer from the external DNS, it passes to the browser.
  • The browser sends the request to the IP address.
  • On receipt of the request from the browser, responds. The communication continues.
I would like to conclude this section with the following notes:
  • The DNS is responsible for translating doman names to IP addresses, and vice versa;
  • It is a distributed and hierachical database; and
  • It is a very important part of the Internet system.

2. The hosts file: the System before the DNS

In the early days, before the DNS was developed and when there were not that many computers around, computer names and their corresponding IP addresses used to be maintained in a text file, named hosts. This file used to be the only way of resolving IP addresses from their corresponding hostnames.
Even though hosts file has been replaced with DNS, it is still in use in all systems.
To illustrate the working mechanism of hosts file, let's take an example of a small organization, say, with the following computer names and their corresponding IP addresses:

Table 1. Computers

Fully Qualified Computer Name Computer Alias (short) name Computer IP address sales Marketing production support admin
The hosts file for the above organisation could be similar to the following:
#Ip_address          canonical_hostname           [aliases..]         sales     marketing    production       support         admin
In the hosts file, the computer details are listed a line per host, and the details are IP_address, canonical_hostname and alias separated by space or tab.
A line that begins with character '#' is ignored.
Once the network is fully connected, configured, and the above hosts file has been copied in all computers, the computers can communicate with each other simply by calling aliases or canonical hostnames.
Let's suppose Production Department computer,, hosts its own website, and if a staff, using Sales Department computer,, would like to access the site, the following would take place:
  • The staff opens his/her browser and type 'production' or '' in the browser address bar, and press 'Enter'.
  • The browser looks for the IP address of the production computer in the hosts file, and gets '' as its IP address.
  • The browser sends the request to ''.
  • The production computer responds.
You will find hosts file in Linux/Unix-based systems at /etc directory.
The hosts file provides a simple and efficient mechanism for small organisations with a small number of computers. It is, however, very difficult to manage a large organisation with a large number of computers. Applying this mechanism in the Internet level (a network of networks) is practically impossible.
Hence, the DNS architecture was proposed.

3. The Domain Name System Architecture

The Domain Name System (DNS) architecture was designed for the Internet as a hierarchical and distributed database system to resolve the Internet's IP addresses from their corresponding domain names, and vice versa.
Since the Internet is a global network, truly enormous in size, with no single country or a region in control in its entirety, the DNS architecture design must be:
  • scalable,
  • better suited for bigger networks with infinite number of autonomous networks,
  • easy to manage, and
  • robust enough to avoid any potential conflicts of IP addresses and domain names.
The hierarchical and distributed design of DNS architecture was the answer for the above-said requirements.
As indicated in the previous section, a device (server, desktop, laptop, tab, mobile phone, etc.), before it can participate in any Internet activities, must have its own unique IP address and hostname (a Fully Qualified Domain Name, FQDN). Since the Internet is a network of networks (millions of autonomous networks), the DNS architecture must provide a robust mechanism to avoid IP address and FQDN conflicts.
The subsequent sections will provide more detail on hostname, domain name, FQDN and other DNS details. In this section, it is worth noting that:
  • despite the size of the Internet (billions of devices at any give time), no two devices can share the same FQDN or IP address (every device must have its own unique and valid IP address and Fully Qualified Domain Name, FQDN); and
  • using the hierarchical and distributed design, the DNS architecture provides a robust system to publish, manage and resolve IP addresses and domain names, and avoid potential IP address and Domain name conflicts.

4. The Internet's Internet Protocol (IP) Address Management

As indicated above, no two or more devices can use the same IP address at the same time, and the Internet has a robustly regulated IP management system to avoid the potential conflicts of IP addresses.
The Internet Assigned Numbers Authority (IANA), a department of the Internet Corporation for Assigned Names and Numbers (ICANN), is "responsible for global coordination of the Internet Protocol addressing systems, and the Autonomous System Numbers used for routing Internet traffic''.
The IP addresses on the Internet are managed as follows:
  • The IANA allocates a pool of unallocated IP addresses to the Regional Internet Registries (RIRs).
  • The Regional Internet Registries (RIRs) allocate their IANA allocated addresses to their respective National Internet Registries (NIRs).
  • The NIRs, in turn, allocate their IP addresses to the Internet Service Providers (ISPs) under them.
  • The Internet users or organsations get IP addresses from the ISPs.
The IANA is also responsible for managing the Internet's root zone, and the .int and .arpa domains. This will be clearer in the subsequent sections.
No two or more devices can have the same IP address and Fully Qualified Domain Name (FQDN) on the Internet. On the subsequent sections, I will explain more on FQDN. As for the IP addresses, it suffices, for our purpose now, to know that the IANA coordinates the allocation of IP addresses to avoid any potential IP conflicts.

5. Domain Naming Structure

Now, we understand that the DNS architecture is responsible for resolving IP addresses from their corresponding domain names, and it was developed for the human users' convenience.
If a user wants to access the website of the Google, he or she uses, instead of the website's IP address. When the request is passed to the browser, the DNS provides the IP address of the to connect the user and the site. It is a convenient way of using the Internet.
In this section, I will go into detail on the domain names and naming structure. At the end of this section, some of the questions I am hoping to answer are:
  • How domain names are formed?
  • What is a Fully Qualified Domain Name (FQDN)?
  • What is the mechanism to ensure there are no domain name conflicts?

5.1. The hierarchical naming structure of Domain Name System

The hierarchical naming structure of DNS forms an inverted tree, of which the root is denoted by character period (.), followed by multiple levels of domains. Like any other hierarchical tree structure, the root represents everything, and as we go from top to bottom, the scope becomes narrower, more specific.


A Fully Qualified Domain Name (FQDN) is a name of an individual host that uniquely identifies it on the Internet. As an example, is an FQDN of my website that uniquely identifies it from any other websites on the Internet.
Please note that a host can be a client computer (laptop, desktop, mobile devices), a server or a service (website, ftp server, etc.) running on a server.
This section is to introduce how we form the FQDN of a host.
The detail of the structure tree is as follows:
  • The root of the DNS hierarchical structure tree is denoted by period (.), and it contains all domains, including all servers, client computers (desktop, laptop, mobile devices, etc.), and network devices on the Internet.
  • Immediately after the Root is the Top Level Domains (TLDs), and some of the TLDs are .com, .net, .org, .gov, .edu, .info, etc. The TLD also has two character country code domain from ISO 3166 country code (for example, .ie for Ireland, .hk for Hong Kong, .np for Nepal, .ph for Phillippines, etc.). For a complete list, please see at
  • The second level domains are mainly organisational domains, such as microsoft, google, yahoo, mybusiness, maadis, etc., so these domains are owned by the organisations or individuals. The organisations and individuals register their chosen domains with Domain Name Registrars.
  • The country code domains in TLD may take common TLD domains like .com, .net., .org, .gov, etc. as its second level domain. For example:,,, etc. In this example, the country code, hk, is the TLD while .com is its second level domain.
  • The Third Level Domains in the diagram represent the hostnames. As indicated above, a host can be a server, a client device, or a service (http, ftp, etc. )

5.2. A Fully Qualified Domain Names and Hostnames

In the diagram, the Third Level Domains are the hostnames.
The domains, one of the three domains I owned, has two hostnames, namely 'www' and 'mail'. A hostname represents the name of the individual host or computer. So, in other words, my domain has two hosts, named 'www', and 'mail'.
The above-said two hosts can be called by their hostname alone within domain, but to make them recognisable on the Internet (outside, however, their Fully Qualified Domain Names (FQDNs) are needed.
A Fully Qualified Domain Name (FQDN) is a domain name that identifies an individual host, or computer, on the Internet. It is formed by including its hostname and all the domains up to the root.
As an example, the has one hostname, ns1, and its FQDN is '' (ns1 + '.' +Second Level Domain + '.'+First level domain + root).
Adding the root domain ('.') at the end of the FQDN is optional.

5.3. Domain, subdomain, and sub-subdomains

The owners of the domain can create any number of subdomains under their domains. In the following example, has three subdomains (sales, marketing, and production):
And, under their domains or subdomains, they can have any number of hosts, In the following example, the domain has 4 different hosts, namely host1, host2, host3, and www:
NOTE: It is worth noting, to get the concept right, that there are multiple domains in the diagram with 'www' as a hostname. Since they are from the different domains, it is perfectly legal as they are referring to completely different hosts.

6. Working of Domain Name System Architecture

The Domain Name System (DNS) is a robust, easy to manage and scalable system, because of its distributed and hierarchical design, and how it is administered and managed.
In this section, I will look into the working mechanism of DNS architecture in greater depth.
Some domains, as I indicated above, belong to organisations, or individuals. For, example, the Google domain in .com domain is owned by Google, Yahoo in domain is owned by Yahoo etc. In the same way, the Maadis domain of .eu domain belongs to me. I registered the domain with one of the Domain Registrars, completing all necessary formality and paying the required fee.
My domain registration process began after the Domain Registrar's confirmation that the maadis domain under .eu domain was free. And, during the registration process, I carried out the followings:
  • I recorded that host will be the authoritative Domain Name System (DNS) for domain; and
  • In DNS, I entered all relevant IP addresses and their corresponding hostnames of the domain.
The above steps taken by my Registrar and myself provided two critical details.
Firstly, it confirms that I am the only owner of domain and will remain so as long as I fulfil all required formalities. On or before the domain's expiry date, a renewal process is needed.
Secondly, the host becomes the authoritative DNS for domain, which means if some users on the Internet want to access the website of or any hosts in domain, they get the relevant IP addresses from its authoritative DNS (
In the next section, I will look at how DNS resolves IP addresses to understand the working mechanism.

6.1. How DNS resolves IP addresses?

To answer this question, I have to go back, once again, to the steps we take to access some resources from a site. Let's suppose, a user is trying to access the home page of domain. The following things happen:
  • The user types on his/her browser, and press 'Enter'.
  • The browser sends its request for domain's IP address to its designated DNS.
  • The designated DNS looks for's IP address in its database (Let's assume, in this case, the designated DNS does not have the IP address of
  • The designated DNS sends the request to one of the 13 Root DNSs.
  • The selected Root DNS sends the list of IP addresses of the Top Level Domain Name Servers that deals with the .eu domain.
  • The designated DNS chooses one DNS from the list and sends the request to it.
  • The Top Level DNS finds the IP address of the authoritative DNS for domain and sends the IP address to the designated DNS (Assuming the Top Level .eu DNS has the database of all .eu domains' authoritative DNSs).
  • The designated DNS sends the request to the authoritative DNS of
  • The authoritative DNS of domain finds the IP address of and sends the IP address to the designated DNS.
  • The Designated DNS passes the IP address of to the browser.
  • The browser sends the request to the IP address of
The above-explained steps are the simplified version of what happens when a user tries to access domain on his/her browser.
A DNS is an integral part of the Internet, and it is so important that we cannot use the Internet without it. All devices that need to connect to the Internet must have at least one DNS assigned to it. In the above steps, I have referred this DNS as designated DNS. The majority of the Internet users gets their designated DNSs from their ISPs when they connect to the Internet, automatically.
In Linux and Unix-based systems, the above-explained designated DNSs are specified in /etc/resolv.conf file.
Every time a user tries to access some websites, the designated DNS is called to find the IP addresses of the websites. On receipt of a request, the DNS searches for the IP address in its own database, and forward its request to external DNSs if the IP address is not found.


In Linux and Unix-based systems, the above-explained designated DNSs are specified in /etc/resolv.conf file. In this file, we can specify one or more DNSs.
When the designated DNS has to find the IP address from the external DNSs, since the DNS is organised in a hierarchical fashion, it starts its search from the root of the hierarchy.
At the root of the DNS hierarchy, there are 13 DNS servers, distributed all around the globe, to provide services to all Internet users. These root level DNS servers do not keep the IP address records of individual hosts, such as,, etc., but they can provide the list of IP addresses of Top-Level DNS servers dealing with the Top-level Domain, such as .com, .org, .net, .eu, etc.
The designated DNS server sends its request to one of the above-explained 13 DNS servers. Since the IP address of was requested, the root level DNS server replies with a list of Top Level DNS servers that handle the .eu domain.
There are hundreds (it is growing, possibly well over 1,000) of Top Level DNS servers, spread around the globe, dealing with top level domains, such as .com, .org, .net, .eu, etc. These top level domain DNS servers as well do not keep the IP address records of individual or organisational hosts, but they can point to the right direction (a list of DNS servers further down the hierarchy or the authoritative DNS of the requested domain).
The designated DNS server receives the IP address of the requested domain ( from its authoritative DNS server, communicating with multiple DNS servers from different levels of the hierarchy tree.
It (the designated DNS) passes the resulted IP address to the requesting browser.

6.2. Some noteworthy points

I provided a simplified working mechanism of DNS architecture in the above section. I, however, omitted some details, for example, DNS caching, DNS working mode, etc., for the sake of simplicity. These details are important, but we can ignore them for now to understand the DNS working mechanism.
One important point I am discussing here is the scalability of the DNS architecture, provided by the hierarchical design of the system. During the registration process of my domain, as explained above, I provided as its authoritative DNS, and updates all relevant IP addresses and their corresponding hostnames of domain in DNS server. There is no requirement to update any upper-level DNS servers and other DNSs. It is a great scalability and manageability feature of the DNS architecture.
As the owner of the maadis.Eu domain, I have total freedom to:
  • add any number of subdomains (or subdomains of sub-subdomains) under,
  • add any number of hosts under and its subdomains, and
  • amend details of my hosts (say changing their IP addresses).
In other words, once the Upper-Level DNS responsible for .eu domain is aware of the fact that is the authoritative DNS of domain (during the registration process), any changes in are automatically reflected on the Internet. No changes in the upper-level DNSs or any other DNSs are required.

7. Installing and Configuring BIND DNS Server

7.1. What is BIND?

The BIND, "Berkeley Internet Name Domain", originally designed and implemented at the University of California Berkeley (UCB) in the early 1980s, is the DNS implementation software to:
  • publish domain names information (hostnames and corresponding IP addresses),
  • resolve IP addresses from their corresponding hostnames, and vice versa, and
  • manage domain names information
on the Internet. It is the most widely used Domain Name System (DNS) on the Internet.
Since it is mature, stable and open source (no licensing fee needed), I am going to implement a simple DNS for my '' domain, using BIND software.
I will be installing BIND in Ubuntu server that I am using at the moment, and it is going to be a very basic level DNS. The intention, basically, is to create the simplest possible DNS quickly, leaving the detail and advanced topics for the future articles.

7.2. Installing BIND

To install BIND in Ubuntu, please run the following commands in console (terminal):
 sudo apt-get install update
    sudo apt-get install bind9 dnsutils
The Ubuntu package 'bind9' installs the BIND, and 'dnsutils' package comes with all necessary utilities for dns testing and troubleshooting.

7.3. DNS Configuration Detail

As indicated above, this configuration is going to be a basic DNS, and for which, I will be using my Ubuntu server with the following detail:
  • Operating System version: Ubuntu 16.04
  • Ip address:
The server, as its IP address indicates, is in my Local Area Network (LAN), behind the Internet facing firewall, so the configured DNS will be the DNS for my LAN to resolve IP addresses of my domain.

7.4. Changing the default DNS (name server) on the system

My ubuntu server with IP address is going to be my DNS for my domain, and to be able to test this DNS, I am going to make this server as my (designated) DNS. And, to do that, I enter the following records in /etc/resolv.conf file:
The above line in /etc/resolv.conf ensures that the dns with the ip address of will resolve IP to hostname, or vice versa, for this system.

7.5. Configurating forwarder for external domains

Update the /etc/bind/named.conf.options file as follows:
forwarders {;
As indicated above, the DNS I am implementing here is to resolve IP addresses/hostnames of domain. If this DNS receives any requests to resolve IP addresses or hostnames of any other domains, it has to seek help from external DNS servers. It can either forward the request to one of the 13 Root DNS servers of the Internet, or to other DNS servers (most users forward to their ISP-provided DNS servers).
In the above example, all requests, except domain requests, will be forwarded to Ip address (Googles public DNS).

7.6. Configurating Primary Master DNS

In this section, the DNS will be configured to resolve IP addresses or hostnames of domain. In other words, this DNS server will be the authoritative DNS of domain.
Please update /etc/bind/named.conf.local file as follows:
zone ""{
       type master;
       file "/etc/bind/";

zone ""{
     type master;
     file "/etc/bind/db.192";
The above file, basically, declares two zones:
  • The "" zone, and
  • The "" zone.
The "" zone is to resolve IP addresses of domain from their corresponding hostnames, and it uses "/etc/bind/" file to perform this task.
The "" zone is, on the other hand, to resolve hostnames from their corresponding IP address, and it uses "/etc/bind/db.192" file to perform this task.
Now, it is time to update /etc/bind/ file as follows:
; BIND data file for local loopback interface
   $TTL    604800
   @       IN      SOA (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
   @       IN      NS
   @       IN      A
   ns1     IN      A
   WWW     IN      A
A brief introduction to the above zone configuration:
  • The $TTL directive stands for 'Time To Live' with the value of 604,800 mili-seconds is indicating that other name servers can cache this domain's information for 7 days.
  • The second line:
    • The '@' represents the name of the domain - in our case;
    • The 'IN' represents INTERNET for its Zone class;
    • The 'SAO', 'Start Of Authority', specifies as the authoritative named server for this domain. The '' represents the email address ( the domain admin/owner: and
    • The Serial, Refresh, Retry, Expire, Negatice Cache TTL (more or less self-explanatory) are its parameters. The serial has to be updated/incremented at every change of information on the file.
  • The 'NS' record specifies ' as the DNS (name server) for domain.
  • The A records assigns the IP address '' for,, and
In the same manner, please update /etc/bind/db.192 file as follows:
; BIND reverse data file for local loopback interface
   $TTL    604800
   @       IN      SOA (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
   @       IN      NS
   10      IN      PTR
   10      IN      PTR
The details provided in /etc/bind/db.192 is, basically, reversal of /etc/bind/ file. The /etc/bind/db.192 resolves hostnames from the IP addresses while the latter resolves IP addresses from hostname.

7.7. Restarting DNS service and testing the Configuration

Restart the service so that the new configuration is loaded with the following command:
sudo systemctl restart bind9.service
To resolve the IP address of, run the following command:
To resolve the host of of ip address, run the follwing command:
  dig -x

8. Summary

The Domain Name System (DNS) Architecture has made the Internet simpler to use. In this article, I introduced the DNS design, concept and working mechanism. I also briefly touched on the implementation of BIND DNS software.
Since the article was to introduce the architecture and provide a good foundation for further study on the subject, I omitted, for the sake of simplicity, numbers of features and details, hoping to cover those in future articles.

A. Revision History

Revision History
Revision 0.0-0 Fri, 16 June 2017 Damar Thapa