A Story of DNS


One day Mickey was taking a walk at the riverside when Minnie came running to him

Minnie – Hey Mickey, Wait for me!

Mickey – Hi Minnie, what happened?

Minnie – I need to talk to you

Mickey – Sure, tell me

Minnie – Do you know what is DNS?

Mickey – Sure I do, Minnie

Minnie – Great can you make me understand, like from scratch

Mickey – I know, the best way you understand is with a Story. Let me tell you one

Minnie – Great, let’s go to some quiet place


Mickey & Minnie went to a quiet place near the river

Mickey – Do you have a Contact List on your phone

Minnie – Yes I do have, what’s about that

Mickey – What does it do

Minnie – Mickey! Stop asking me stupid questions. Everyone knows, contacts are to save people names with their phone numbers

Mickey – Yes! So it’s like matching people names with their numbers and you can search it anytime and get to the right person

Minnie – Of course

Mickey – Now you cannot remember the phone numbers for every person, but you can easily remember the names and with that can look up in the Contacts and get the numbers and reach the person

Minnie – Yes, Of course!

Mickey – Like people have phone numbers, in the same way, every computer or server or website on the internet has an IP address

Minnie – Okay

Mickey – And as it is difficult to remember the IP addresses for every computer on the internet, they have easy to remember names called Domain Names

Minnie – Okay, so like people have names and numbers, Similarly, on the internet, computers have a name (domain name) and an IP

Mickey – You got it. Now whenever we have to reach any server or computer or application we use a domain name like www.example.com

Minnie – Yes, that’s true

Mickey – Now in order to connect to the physical server, internally, the network needs to know the IP of the system to connect. Now the process or system that looks up the IP and connects to the right system is called DNS or Domain Name System

Minnie – Okay I am starting to get it

Mickey – See internet is a giant network of computers. Each computer is assigned a unique IP address that helps other computers identify it

This IP address is a string of numbers like 192.168.10.101

Now imagine if you have to remember a unique IP for every website you want to visit, it will be difficult

Minnie – Yeah

Mickey – Therefore Domain Names were invented to solve the problem. So now we can use alphabets and have easy to remember names like example.com, google.com

DNS or Domain Name System translates these domain names into IP address and locates the right computer on the internet

So in very simple words
DNS, or the Domain Name System, translates human-readable domain names (www.example.com) to machine-readable IP addresses (192.168.1.10)

Minnie – Okay, now I get what is DNS and what it does. But how exactly does it work

Mickey – Okay, that’s interesting

There are 5 Steps

  1. You open the browser and type www.example.com and hit Enter. Immediately there is a check to see if you have visited this website previouslyIf you have, the DNS records are found in your computer’s DNS cache, then the rest of the DNS lookup is skipped and you will be taken directly to www.example.com

    DNS cache is like an address book saved on your computer with the domain name server (DNS) information of each website you visit. You can clear it if you want

  2. Suppose you are visiting this website for the first time from your system, then no DNS records are found, then a query is sent to your local DNS server. Usually, this is your Internet Provider’s server and is often called “Resolving Name Server” or DNS Resolver
  3. If the records are not cached on the Resolving Name server, then the request is forwarded to a “Root Name server” to locate the DNS records. Also called Root ServerRoot Name servers are designated servers around the world that are responsible for storing DNS data. Once the DNS record is found, it’s cached by your computer
  4. If the name is still not resolved, the request is forwarded to TLD nameserver (Top Level Domain server)
  5. Now that the DNS records are located, a connection to the server, where the website is stored will be opened and www.example.com will be displayed on your screen

Minnie – Wow, that looks like a long process

Mickey – It all happens in less than what you take to blink

Minnie – Wow! I feel so good now

Mickey – Okay, let’s go home

Minnie – No let’s sit here. I want to enjoy the sunset

Mickey – Sure, Minnie

Minnie – You are my best friend

Mickey – I am always here for you 🙂

about the author more stories


References
https://www.wpbeginner.com/glossary/dns/
https://totaluptime.com/kb/how-does-a-dns-query-work/

81