DEV Community

Behind the scenes: From the moment you enter a URL

Saloni Yadav on May 27, 2020

Recently in a job interview, I was asked- "What happens from the moment you enter a URL in the browser?". Although, I had an overall idea, I was qu...
Collapse
 
salyadav profile image
Saloni Yadav • Edited

I was asked some interesting questions on linkedin, which I would like to post here as well:

1) Where is the DNS resolver located? Is it in our machine?

2) Does every request, after reaching the DNS resolver, follow the sequence of going to root server, then TLD server and then ANS?

TL;DR

  1. DNS Resolver is in fact only a software service that can run even on your computer, but most often it is provided by your Internet Service Provider(ISP). This DNS Resolver service sends requests to the wider hierarchy of DNS Servers out in the world on behalf of your Operating system.
    Now, let's assume the most common case- that is, the DNS resolver is hosted by your ISP, that means, it is common for a bunch of local computers/devices connected to this network. Needless to say, DNS resolvers are distributed anywhere and everywhere across the internet.
    Note: You can even configure your DNS resolver setting from Control Panel -> Network and Internet Settings. But by default, it is taken as that of your ISP (which ever WiFi or Ethernet you are connected to).

  2. As to whether the whole DNS Root server to ANS resolution happens every time the request reaches the resolver- No.
    As I mentioned above, a resolver is shared by a bunch of local clients in a network. The resolver has its own cache to maintain the bunch of resolved domains. So if you one client on that network accessed a domain, and then another client (say your phone) tries to access the same domain, it will be picked up from the cache.

Additional FYI:
Why do we maintain so much hierarchy to fetch a domain instead of having it in our system?
When you go and buy a domain, say from #GoDaddy, it is their responsibility to update the IP Address of the servers they are alloting over to the whole network (TLD, ANS). Imagine if this weren't so centralized, it would be an odious task to update every client with this info.
On the contrary, we have only a total of 13 Root Servers across the world (named from 'A' to 'M' - So unimaginative! :D), maintained by #ICANN (Internet Corporation for Assigned Names and Numbers), which are responsible for the world of DNS! PFA the list of organizations that host these root servers.
For the list of Root servers across the world-
ionos.com/digitalguide/server/know...

Collapse
 
fayaz profile image
Fayaz Ahmed

Very informative thanks. Postman had asked me this very same question on their interview long back.

Collapse
 
salyadav profile image
Saloni Yadav

Wow, itโ€™s a small world. Got this question for Frontend Dev role in Postman only recently. :D

Collapse
 
fayaz profile image
Fayaz Ahmed

๐Ÿ˜‚ are we allowed to even discuss this?

Too bad I wasn't selected for the role.

Thread Thread
 
salyadav profile image
Saloni Yadav

Hahaha. Same here! Well, Glassdoor does quite the same- discussing interview questions. So I m guessing this is no harm. Hope it prepares others who go for a postman interview. ๐Ÿ˜‚

Thread Thread
 
fayaz profile image
Fayaz Ahmed

There should be a list of questions asked in interviews as well as assignments, ofcourse hiding the employers name.

Maybe beginners can take advantage of it.

Thread Thread
 
salyadav profile image
Saloni Yadav

Thatโ€™s a good suggestion. May be I will take some time to compile this sometime :)

Thread Thread
 
fayaz profile image
Fayaz Ahmed

I was already making one. Let me know if you want to add them as well.

Thread Thread
 
salyadav profile image
Saloni Yadav

Ah awesome. Will send in some interesting questions then!

Collapse
 
musale profile image
Musale Martin

For sure there's so much to explore on this subject. I always have the basic idea of how it all works and at times I've read about how it works on different scenarios like on a secure HTTPS connection. Pretty interesting backend stuff. This article is a great starting point for anyone interested.

Collapse
 
salyadav profile image
Saloni Yadav • Edited

Thank you Musale. Itโ€™s quite overwhelming how many back and forth processes are involved before one page renders. Yet we lose our patience if it takes more than a few seconds to load. If you are interested, look into the third point that I mentioned - that parsing stops until script is completed. There are a lot of trick questions based on that concept. And the results are quite surprising.
And if you are interested in backend, one thing I did not mention here was the three way TCP connection that takes place between the browser and the data server. Thatโ€™s quite interesting too. :) Glad you liked the article.

Collapse
 
papaponmx profile image
Jaime Rios

Sweet, thanks for sharing!