Comprehensive DNS Guide: An In-Depth Look
Hey all dns was one topic which troubled me for a long time and also became a hurdle for me in making a projectđĽ˛
Lets get over it and know DNS in-depth so we get a complete understanding of DNS.
What is DNS
DNS in a laymanâs terms is a dictionary for short. A dictionary which can be used to find the IP of different-different sites we visit.
Computer donât understand our language..
They do but actually they donât đa dns gives our browsers the IP addresses of our sites whose names we can memorise easily. It is difficult for us to remember IP addresses and for computers its the opposite, they work seamlessly with numeric addresses.
DNS Domain Name Subsystem, which acts as a middle-man, they convert the something.com to 100:222:4023
How is it done?
Its simple you already know how to do it!!, you go to a dictionary for finding the meaning of a new word, the dictionary contains a huge chunkk of words and then you sagerigate the particular word that youâre interested in and get to know the meaning
Its the same concept with DNS! Simple rightđ
Think of DNS as a huge dictionary which contains the list of key-value pair where the something.com is the key and the corresponding ip address/es are the response to that site.
But its a huge dictionary how do we segregate these many words?
We start filtering out the location on many basis such as start with the domain type .org or .com that clears our way and segregates the site addresses, for a more indepth understanding read article.
I hope you have read the article and now following up!!
Types of domains
A record
AAAA record
CNAME record
Naveserver (NS) record
1) A Record
A record is the most IMP record type, The âAâ in A record stands for âaddressâ. An A record shows IP address for a specific hostname or domain.
eg.
Type | Domain Name | IP Address |
A | example.com | 81.32.11.53 |
This gives direct IP address to a particular site name of what is mentioned.
It supports only IPV4 addresses.
2) AAAA record
AAAA record is same as the A record but it is an upgraded version of the A record as it also offers the IPV6 format for the ip address the newer protocols and more range of IP addresses it can handle.
3) CNAME record
CNAME is âcanonical nameâ is like that spider man meme, one pointing to the other đ, it gives the address to another domain whose ip it is refering to.
Didnât understood ? Iâm here to help
A CNAME record will map a domain name to another domain name (canonical name or target), When a client queries a DNS server for a domain name that has a CNAME record, the DNS responds with canonical name.
The client has to make a second DNS query to resolve the canonical name to an IP address.
Easy example:
You have a website hosted at example.com you want to create an alias blog.example.com that points to the same website. You would create a CNAME record like this:
blog.example.com. CNAME example.com.
What happens when user tries to access blog.example.com, the DNS resolution process would be:
The client queries to a DNS server for blog.example.com
The DNS server findds the CNAME record and responds with example.com.
The client then makes a second query to the DNS server for example.com
The DNS server responds with the IP address of example.com
The client connects to the server using the IP address of example.com.
3) Nameserver record
A Nameserver (NS) record in DNS specifies which DNS servers are authoritative for a particular domain or subdomain.
It tells the internet where to go find the DNS records(like A, AAAA, MX,CNAME)
HOW IT WORKS?
When a DNS server needs to find information about a domain, it first queries the root servers to find the appropirate Top-Level Domain(TLD) servers(eg. .com, .org, .net).
Then⌠The TLD points to the authoritative name servers for specific domain using NS record.
This is the way a NS record is used to find the authoritative server.
E.G. => you want to find example.com. You want to use name server provided by your hosting provider, which are => ns1.hostingprovider.com ns2.hostingprovider.com and ns3.hostingprovider.com.
example.com. NS ns1.hostingprovider.com.
example.com. NS ns2.hostingprovider.com.
example.com. NS ns3.hostingprovider.com.
Client resolver queries a root server.
The root server directs the query to the .com TLD servers.
The TLD server provides NS record for example.com âns1.hostingprovider.com ns2.hostingprovider.com and ns3.hostingprovider.com.â
The clientâs resolver then queries one of these authoritative name server (e.g. ns1.hostingprovider.com)
The client connects to the web server using the IP address.