How DNS Works

In Layman language, Domain Name System (DNS) gives human-understandable names to computers. Here, Computers will have an IP address like ( and Domain Name will help when a human tries to access the computer. So, DNS provides the mapping between domain names to IP addresses and helps to communicate between humans and the Computer. In this article, we will see How DNS Works

DNS Terminologies.

Before understanding How Domain Name works, it is important to know the Terminologies of Domain names.

Domain Name

Domain Name is like a Phonebook. We can register a Domain name from any Domain Name Registration websites. Overall, The Internet Corporation for Assigned Names and Numbers (ICANN) is Managing Internet Protocol numbers and Domain Name System root.

Domain Name Explanation
Domain Name Explanation

Top Level Domain

Say, “” as the domain name. In this “.com” is the Top-Level Domain. This denotes the purpose of the website.

  • .com – Commercial/Business
  • .org – Organization
  • .net – Network
  • .int – International
  • .edu – Education
  • .gov – Government
  • .mil – Military

On top of this, Many Domain Name Registration websites provide customized Top Level domain names.

Then, we have Country codes Top Level Domain. Like .us for USA, .in for India. For more, visit List of Internet Top Level Domains

Second Level Domain

Second Level Domain is the main name and unique, which will refer to the organization that registered the domain name with a domain name registrar. Here in “”, “digitalvarys” is Second Level Domain.


The Subdomain is the part of Second Level Domain. Say in “”, “resource” is the Subdomain. This is very useful in redirecting many sections of the website. You have many subdomains under a Second Level Domain.

Domain Name Server

Domain Name Server is the system which will have all the domain names and respective mapped IP address. Each entry is called Records. When the end-user requests by domain name, the Name server will serve with the IP address.

We have many types of records Lets discuss a couple of important record types

  • A Record – Is the most common Record type, which is used for IPv4 addresses.
  • AAAA Record – This is for IPv6 addresses
  • ALIAS Record – Virtual record name that maps to another name.
  • CNAME Record – Canonical name which maps one alias name to another.
  • URL Record – Is the Record type which will redirect using HTTP 301 status code.
  • MX Record – This is to Map the mail exchange server used for SMTP.
  • NS Record – Name Server (NS) record type maps an authoritative name server.
  • TEXT Record – The text record is having the unformatted text strings.
  • CERT Record – which will have the encryption certificates
  • PTR Record – Reverse-lookup Pointer records which mean, it will give you the Domain name if you request for IP address
  • SOA Record – Start of Authority record is the information of the DNS zone file.

There are many more which will be useful while configuring the Record type.

How DNS Works

When an end-user sends a request to the webserver using the domain name, it will first send to the DNS server where the record of the webserver is entered and mapped with the IP address of the Machine.

How DNS works
How DNS works

Take the above image as an example. Wen end-user sends a request for index.html file using “” which is the domain name of the server, the process will happen in the following order.

  1. The request will connect with the DNS server and where the record for the domain name ( is mapped.
  2. Then, the DNS server will respond to the user with the IP address ( of the requested Web server.
  3. After that, User’s browser will use the IP address ( provided by the DNS server to request index.html to the Web server
  4.  Then, the web server will respond to the content which is requested by End-user.

Since this is the Cloud era, almost all cloud service providers are having their own DNS servers to help their customers to map their application Instance address to the domain name to expose their application to the public world. Like Cloud providers, almost all the Hosting providers are having their own DNS Servers.


In this article, we have discussed How DNS Works and in our upcoming articles, we will see what the composition of the DNS server is, Detail discussion of the terminologies of DNS server, Record types and how-to setup your own DNS server. Stay tuned and subscribe DigitalVarys for more articles and study materials on DevOpsAgileDevSecOps and App Development.

3 thoughts on “How DNS Works”

  1. Pingback: Homepage

Leave a Reply