What is DNS??

What is DNS??

or the Domain Name System

Suppose you jumped into a taxi late one night and just told the cabbie to go to your house, without giving him the actual address.
Unless they're a weirdo stalker, it’s highly unlikely that he would know the address and how to get there without asking you for your actual address and if that were the case, it'd be best to take an Uber. Just like taxi drivers, your browser doesn't just know the address by a simple name, it uses a complex coordinates system in numbers which is then translated to human languages in order for us to remember more easily. 💡

drew-willson-ho0uoqzvDhk-unsplash.jpeg

Photo by Drew Willson on Unsplash

Internet-connected devices have a much easier time figuring your address out due to the Domain Name System or simply, DNS. Although we may type in easy to remember URLs, such as amazon.com google.com, in order to take you there, our browsers need to know our IP addresses of the sites that we’re trying to access. In order to do this, there is some complex behind the scenes calculations taking place.

photo-1558494949-ef010cbdcc31.jpeg Photo by Taylor Vick on Unsplash

What is DNS? In order to answer that, we should first ask ‘what is a network?’ A network is simply a group of computers or devices that are connected to each other. 'The Internet' itself, is a global network of networks, connected to each other, all around the world. So, on the internet, if we wish to communicate with another device on a different network, we need to know that other device’s IP address. IP, or Internet Protocol, is numeric and is often very unmemorable.

IP-Address-Blog-01.png

Just as computers and devices have IP addresses, so do the websites that we like to visit, as mentioned above, the IP address where the website is hosted is used to load the website in the browser. How does this work, as we input the Domain Name of the website in the browser? How does the browser find the IP

The browser sends a request to the DNS, kind of like the Yellow Pages of the internet to seek out your IP address of the server? The answer is that the browser uses what is called a DNS, which helps the user get the IP address from the domain name. Once our browser has the IP address, it will jump from different routers to different servers until it reaches the correct server to load the website.

DNS Resolution or solving

First, the browser will check the cache and see if the IP address is there from previous visits. If it isn't there, it will look at the DNS cache. If it is also not there, it will look at the host file to see if there is a mapping from the domain name to the IP address - if found, the IP address is found at the website will load.

Recursive DNS Server If not found, your browser will communicate with your Recursive DNS Server, alternatively known as your ISP (Internet Service Provider). The IP address might be found in the cache as another user has previously visited that website before.

Root DNS Server If the IP address isn't found, your browser will communicate with the Root DNS Server - a name server for the root zone of the Domain Name System of the Internet itself. This has the Top Level Domain (TLD) addresses of the specific domain that the user is searching - whether it be .com or .edu etc

photo-1606814540563-5c02d62fd409.jpeg Photo by Compare Fibre on Unsplash

TLD to the Authoritative Name Server

After retrieving another request from the TLD to contact the Authoritative Name Server, the request will go to the Authoritative Name Server. This server returns answers only to queries about domain names that have been specifically configured by the administrator. Here, the browser will retrieve the IP address of the domain name and from there, will go to the recursive DNS server where it might be cached which will be sent to the user's browser, then the browser will request the website server and pull up the website from there. phew! and all that happens in microseconds.

two-computers-on-same-ip-network.jpeg

That is how the IP address is found on the internet thanks to DNS.