Many of us would already know what a DNS is but for starters, it is the thing that converts the URL to IP address when we to hit a URL.
Steps:
1. The moment we hit the URL , our browser searches in the cache for DNS resolution and if it doesn't get it ask for our ISP's name server. Here is where Recursive name servers come into the picture.
The part I want to focus is how underrated and much unknown is this system to people apart from the fact I mentioned above.
In fact, I am lucky enough to get an in-depth look at how crucial DNS system and how it forms the backbone of highly scalable distributed system where you agree to an SLA for some milliseconds or might less at InMobi. So this post is more focused towards starters and not so fancy because that's how it should be understood.
Why is DNS important ?
Imagine you have to deploy a service on the internet and you agree to your consumers for 100 or 200 ms latency but an improper DNS setup or DNS query can add 200ms or up of latency and added to that your geolocation.Hence it becomes important to tune your DNS server to your need.Let's get into details. This is a very high-level view of things and people should explore more.
DNS Server:
The basic work of DNS is to the mapping of URL to an IP address.But this is how it does.
Two types of DNS servers:
Authoritative Name Server
Recursive Name Server
Let's take an example: news.google.com
Here com : Top Level Domain , google : second level domain , news : subdomain
DNS server reads a URL from right to left and does a recursive travel of name servers until it reaches Authoritative servers.
Steps:
1. The moment we hit the URL , our browser searches in the cache for DNS resolution and if it doesn't get it ask for our ISP's name server. Here is where Recursive name servers come into the picture.
By the way even after "com" there is a dot which we don't need to enter explicitly and that dot represents root server.
What it does is from the right of URL it starts parsing and queries to root(i.e dot .) server (one of many root servers)for the address of com server. And for all top level domains(lime com,io,..etc) these are fixed server addresses hard coded into DNS servers.
2. Then com server has info about the server which has a record about google.com and make a referral to it.This is where when we purchase a domain we have to register our domain to a name server and is called Authoritative Name Server.
So the flow is :
URL --->Recursive Name server--->Root Server-->Top Level Domain server--->Authritative Name Server
For more info refer :
https://www.appliedtrust.com/resources/infrastructure/understanding-dns-essential-knowledge-for-all-it-professionals
Comments
Post a Comment