DNS — 101: What is DNS and How Does it work? — Part-1

4 min readOct 2, 2022

Hello Friends, Hope you are all doing great. I have been planning/thinking and keep on postponing this to write about DNS topic for a long time. If you are familiar with computer networks i.e, how two devices (computers, mobiles, routers..)communicate with each other then by this time you already know that most of today’s internet traffic follows TCP/IP protocol. DNS (Domain Name System) — is one of the important and fragile systems which adds more value to TCP/IP communications. We will discuss the same point at end of this post so that would make more sense than now. Let’s get more knowledge and info on DNS. By the way, our goal is to understand the below DNS flow by end of this DNS series posts(More parts on the way 😊 ).

1. DNS flow (in Unix-like systems)

How Two Devices connect via TCP/IP:

Although this post mainly focuses on DNS, will have a high-level glance at TCP/IP and other topics to understand better.

2.Typical client-server connection.

All TCP/IP connections based on IP addess and Port numbers of both client and server devices.

But when we say the above sentence to non-IT people then immediately we get “
what..? wait a second🤔. But I never typed/remembered(first of all I don’t even know)any IP address and port number, we just enter the website address like facebook.com,google.com and some other public websites.”

If we are not typing the IP addresses, port numbers and only typing the website name and still we are able to connect to the servers. Does that mean something is converting that website name into an IP address and port number?
And the answer is Yes, You are absolutely correct and that’s the beauty of the DNS system. But here, DNS maps only website names to IP addresses. Your client software (Browsers like Chrome, Firefox.., CLI tools like cURL, apps like postman… etc) adds default port numbers sometimes. For example, if you are using HTTP protocol then the client adds the destination port number as 80. Similarly HTTPS -> 443, SSH -> 22 …

Now, our focus is on DNS so let's ignore parts and concentrate on how website address maps to IP address. Will talk detailly on other topics in future posts.

Few important DNS terminologies and their definitions:

Note: It is absolutely fine if you are not able to understand the below definitions but I can bet that you will understand them after reading this DNS series posts fully.

3. DNS map table explanation.

Before looking at definitions of important terminologies please observe the below table carefully and the first diagram too….

A Record Type: An entry/item type in the DNS database which stores IPv4 address type. Generally, this IP address points to the Actual Server(Check the 8th pointer in the first diagram) to which the client needs to establish a TCP/IP connection. Example:

AAAA Record Type: Same as A Record type but stores IPv6 Address.

NS Record Type: An entry/item type in the DNS database which stores the IPv4 / IPv6 / DNS names of the Authoritative Nameservers which in turn tells the A / AAAA record or Name servers which in turn tells the next Nameservers / Authoritative Nameservers.

Authoritative Nameservers: Servers that answer/respond as A/AAAA records for DNS requests for a domain.

Nameservers: Servers that help(By providing the address)to reach Authoritative Nameservers which gives the final A / AAAA record which holds the Actual server IP address.

DNS Client: A Device that asks for a DNS record (A, AAAA, NS…) to the DNS server.

DNS Server: Here multiple types are present like Nameservers, Autherativr Nameservers, TLD servers, and Root DNS servers. Definitions for each kind available respective terms.

TLD Nameserver: It is a type of Nameserver but it holds the NS Records of a specific top-level domain like .com, .in, .org…etc. Check the 3rd column in the 3rd diagram please to understand more.

Root DNS Nameserver: It is a type Nameserver but it stores the NS records for all TLD domains. We have a total of 13 Root DNS Nameservers all over the world which are maintained by reputed organizations.

I know, too many definitions and confusing if you are reading the first time. But there are the minimum definations that help us start learning DNS. Still, I have intentionally ignored a few terms which are not required to understand the DNS echo system for now, but definitely we will mention them as and when we need to know them.

I think we are in a good state to speed up to catch the DNS learning train where we learn the complete DNS name resolution flow process i.e., what happens when we hit the “ENTER” button after typing google.com / medium.com in a client-like web browser. More specifically, will discuss a lot about the first diagram a lot in the next part. I will update the part-2 link in this post as and when I publish that.

I Hope, You liked this article. More articles related to DevOps tools, Linux and AWS on the way so please follow me for getting the notifications. Bye for now 😀.