Jan 9, 2023 By Priyanka Tomar Back

What is DNS | How DNS works | What Happens When You Visit a website | How does a website open

Before understanding the Domain Name System (DNS) we need to understand a bit about domain name of any website and Ip (internet protocol) address.

Domain name is your website name such as google.com or cyberpathshalaindiaindia.com or any website name. Domain name is unique identity of your website and with every domain name an IP address is associated.

Domain is divided into three parts-

  • Primary domain
  • Sub domain
  • Top level domain

Further Top Level Domain (TLD) is divided into three types of domains-

  • Generic TLD – its examples are .com, .net, .edu, .gov etc.
  • Country TLD – its examples are .in, .uk, .us, .jp etc.
  • Inverse TLD – it is ip to domain name mapping or mapping the IP address to its name.

What is IP (internet protocol) address- Ip is a unique numeric label eg( ) assigned to each device connected to the internet. Internet is comprised of connected digital devices such as computers, mobiles phones etc. These devices connect with each other via IP address. Internet protocol has certain rules that helps digital devices to communicate with each other. For our day-to-day activities we use IPV-4 and IPV-6.

Now let’s understand, what is DNS, how does DNS works-

We human being communicates via name and computer communicates via numbers. For example, if you want to talk to someone then you will search for his/her name in your mobile and dial. But as you press the name, mobile phone dials the number. So mobile communicates via number, one mobile number looks for another mobile number. This communication difference has been resolved via DNS.

Domain Name System/server Translates domain name to IP address. It tells the IP address of any website such as google.com. Without knowing the IP address we cannot connect with other computers or devices or even cannot open any website.

DNS resolves the website name with IP address.

We type google.com and computer looks for its IP address i.e. numeric address.

Main component of DNS system is DNS resolver, it acts as the phone book. DNS works on application layer, there are multiple layers in computer network system. DNS is not a single system it is large set of distributed systems

There are three main kinds of DNS Servers

Primary servers –The primary server is the authoritative server for the zone

Secondary servers –Secondary servers are backup DNS Servers

Caching servers they provide only cached-query service for DNS responses.

Suppose ou type google.com in your computer’s browser and web browser has its own cache memory (what is cache memory- it stores some data for short duration of time).

When you type google.com in your browser, it first searches for this IP address in browser cache memory and in case IP address is not there then it reaches to DNS. DNS resolver has its own cache. If it founds the IP then website opens and in case it don’t have IP in its cache then its route the request to root server.

Root server– these are placed at different location across the globe and there can be multiple root servers. There are organizations who manages root servers.

suppose root server also does not have any information about website then it reaches to TLD server which is also root server but has information about all top-level domains. .com is the top-level domain. Suppose it also don’t have the information then it sends request to authoritative name server. Authoritative name server has all the information about DNS

Authoritative name server sends back the IP address of google.com /website to the DNS resolver and DNS resolver stores it in the cache and send it back to the web browser. Now web browser has the IP address of google.com (it was looking for). Now it sends the request to the particular web server that points to that IP or wherein your website is stored, and browser displays the webpage.

Hackers do target DNS servers, they are the most targeted devices. To hack any website, DNS are targeted first.

Hope now we all understand the technology behind opening one simple webpage of any website.