DNS ( Domain name system)
All the computers on the internet for example laptop, pc and smart phones communicate with each other using numebers these number s are known as IP address e.g (192.168.1.0) When someone opens webrowser and search for a website you don’t have to remember an IP address of that perticular website. Instead ,we just gotta remember name of that site (abc.com) this name is called Domain name system (DNS) and you still end up in the right place.
DNS is like a phone book of the internet which has to get to a selected wesite. Each device connected to the Internet has a unique IP address used by other machines to find the device. DNS servers eliminate the need for humans to memorize IP addresses such as 18.104.22.168 (in IPv4), or more complex alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).
How Dns works?
A DNS service such as Amazon Route 53 is a globally distributed service that translates human readable names like www.Abc.com (Domain name) into the numeric IP addresses like 22.214.171.124 that computers(end user devices) use to connect to each other.
The internet DNS system works much like a phonebook in our mobile system which manages names and numbers assigned to it like DNS connects particular Domain name to a particular IP address.DNS servers translate request for Domain names into IP addresses, controlling which server an end user will reach when they type a domain name into their web browser. These requests are called queries.
How DNS servers load a wesite through Domain names
when you enter a particualr domain name firstplace your computer looks for the corresponding IP address is its local DNS cache, which stores information that your computer has recently retrieved.
If your computer doesn’t already know the answer, it needs to perform a DNS query to find out.
DNS recursor:The recursor is like an librarian who is asked to go find a particular book somewhere in a library and collects the book name ,can lead you to particular book shlef.Particularly works on the request made by the user or you may say queries and add some additional requests in order to lead to particular ip address.
Root nameserver: Root server can be called as first step to lead towards conversion of domain name to ip address. It is like an INDEX of library that knows which book is in which rack in the so wide library .
TDL server:The top level domain server (TLD) is like an specific rack of books in a library which is found after applying rootname server . This nameserver hosts the last portion of a hostname abc.com, the TLD server is “com”
Authoritative nameserver. This is the finanl step that leads to the domain name it leads to the particular book in that rack which we reachred by TDL sever. It will send the ip address of the required hostname back if is has access to it.
Ask the authoritative DNS servers: The TLD name servers review the next part of our request www.abc.com and direct our query to the name servers responsible for this specific domain. These authoritative name servers are responsible for knowing all the information about a specific domain, which is stored in DNS records. There are many types of records, which each contain a different kind of information.
Retriving the record from local cache:The recursive server retrieves the A record for dyn.com from the authoritative name servers and stores the record in its local cache. If anyone else requests the host record for dyn.com, the recursive server will already have the answer and will not need to go through the lookup process again
answer of the query:With the answer, recursive server returns record back to your computer.Your computer stores the record in its cache, reads the IP address from the record, then passes this information to your browser. The browser then opens a connection to the webserver and receives the website.
What is authoritive Dns server and recursive DNS resolver :
Both of this severs are integral part of DNS query, but wecan say abot it as recursive resolver is at the begging of the DNS query and authoritive is at the end
Recursive DNS Resolver :
The recursive DNS resolver is at the first that responds to recursive request from a user and than it tracks down the DNS record. It does this by performing series of request till it reaches the authoritve DNS server for the request record or if the times runs out error thano record found is found
Rcursive Dns resolver does’nt always need to to make request and follow the path to track down the records needed to track down the client , caching is a data persistent process that helps to shorten the necessary request by serving the requested recorde earlier in the DNS lookup.
Authoritative DNS server
Authoritative DNS server is a server that holds the resource records This is the server at the end of the DNS lookup chain that will respond with the queried resource record, at the end allowing the web browser making the request to reach the IP address needed to access a website or other web page . An authoritative nameserver can satisfy queries from its own data without needing to query another source, as it is the final source of truth for certain DNS records.
What are the types of DNS Queries?
In a DNS lookup there are three types of queries occur. In an ideal situation cached record data will be available, allowing a DNS name server to return a non-recursive query.
Recursive query – In a recursive query, a DNS client requires that a DNS server will respond to the client with either the requested resource record that is after performing series of queries or an error message if the resolver can’t find the record.
Iterative query – in this DNS query client will allow a DNS server to return the best answer it can. If the queried DNS server does not find a match for the query , it will return a referral to a DNS server authoritative for a lower level of the domain namespace. The DNS client will then make a query to the referral address. This process continues with additional DNS servers down the query chain until either an error occurs.
Non-recursive query – typically this will occur when a DNS resolver client queries a DNS server for a record that it has access to either because it’s authoritative for the record or the record exists inside of its cache. Typically, a DNS server will cache DNS records to prevent additional bandwidth consumption and load on upstream servers .