What is DNS stand for? and How does it work?
DNS or Domain Name System. is a service that runs on all of our computers and mostly over the internet by big servers, simply put DNS translates any IP address into a domain name. Not clear yet? let's see an example.
Imagine we want to visit www.youtube.com, in order for us to communicate with that site we need to know its IP address, every device, website, and server has its own IP Address, the way we do it is by requesting that address from the appropriate DNS server, which is usually the DNS server of the Internet provider. Here the request is checked against the DNS database and, if available, the corresponding IP address is sent in response. This allows the user's browser to be directed to the desired web server on the Internet. Alternatively, the IP address can be translated into the domain address.
Here is another example, we want to hit ww.google.com, usually, every computer keeps a cache with domain names, The server from our internet provider also keeps a cache of domain names, if it's not there then our ISP (Internet Server Provider) domain server is going to ask another machine.
Our ISP is going to ask for a root name server, which are servers provided by trustworthy organizations that we know the IP of, so basically our ISP is saying “I don’t know the IP for?google.com?but I’m going to ask a close friend that might help you with your request”, this close friend might not also know the IP for?google.com?but it can look through its address list, after checking it finds that there is a domain?ns1.google.com?which might help you.
So the request gets redirected to?ns1.google.com?and then most probably that domain server is going to have the correct IP address for?google.com?and your request will get solved.
So we finally have an IP address. All this process seems a little slow taking into account that we don’t know how many domain servers are going to be requested before hitting the correct response, this is all solved by caches that are hosted on every domain server, from your ISP to?ns1.google.com?working basically as a distributed database.