DEV Community

Vaibhav Namburi
Vaibhav Namburi

Posted on


What happens when you type in

How Does the Domain Name System work?

How does the internet know what to get you and how to get you your website?

This blog will be relatively shorter than most because it’s straightforward to explain, considering that a few steps are going to be skipped and only the main necessary logic points will be explained!

Lets go!🚀

Side note: have a look at the diagram, that should simplify things for you 😀

When you type in in your browser what happens?

You set up a “query” or a question to send to a server. The first server your query hits is called the Recursive Resolver, which is usually operated by your internet service provider (Vodafone, Telstra). The recursive resolver knows which other DNS server or domain name system servers to ask the original question of “What is the IP of” — IP stands for internet protocol, think of it as an address, or perhaps like your phone number.

The first DNS server the recursive resolver talks to is the Root Server which are servers running all over the world and have information about Top Level Domains such as .com/.net. So the recursive resolver asks the root server for DNS info regarding .com. — Note that there's 1000s of servers supporting the root and its the DNS’ job to find the answer to your query quickly!

The Top Level Domain DNS server stores information regarding the second-level domains i.e the .com sever stores information regarding I.e the TLD DNS server responds back with the IP address of the domain’s name server, which gives us the next clue!

The recursive resolver then takes this IP and sends a query to the domain’s name server, this DNS server knows the IP address of our website and returns to the recursive resolver the IP address of our website.

After all this, the website appears in our browser, and voila done!
PS all this happens in a fraction of a second!

Nothing in programming is magic. Except CSS...

Top comments (6)

sagarb3 profile image
Sagar Bhattacharya

Something in between is missing in the flow , what happens before any server hit , between the system and local router , if the post highlighted that too it would have been great. Magic is just illusion

m0ntassar profile image
Montassar JDIDI

To be accurate, the original question is "what is the IP Address of the server hosting content of"
Did you know that the server that know the IP Address of is called the Authoritative Server?
Did you also know that you are offending the terms of use of by taking a screenshot of a board to get rid of the watermark ?

veebuv profile image
Vaibhav Namburi

Nope the original question was the question I just asked myself. It was something I wanted to know 2.5 years ago and wrote about it in medium and now shifted it across.

AlsoI've been paying for sketchboard since 2017 when I did udemy courses, if that's what you're trying to imply. I'm sure a single screenshot won't kill their business and if it is really that big of an issue I'm sure I can draw that up on something else and post it up 😂

m0ntassar profile image
Montassar JDIDI

I was pointing the fact that you asked the question with wrong vocabulary, and it could be misleading for beginners:
IP is not IP Address
A domain name does not have an IP Address, a server does

Here is a nicely written article about DNS :

I won't do further comments about, if you can draw this simple figure, the do it legally

akshaymarch7 profile image
Akshay Saini

An attempt to answer the age-old interview question "What happens when you type into your browser and press enter?"

veebuv profile image
Vaibhav Namburi

Naaah haha I just moved this from my medium account. I wrote this in 2017. And wow people actually ask what happens during an interview ?


Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git