DNS

What Is DNS?

The Domain Name System is a service on the Internet that maps IP addresses and domain names to each other and aids users in accessing the web easier and faster.

Just like we require clear directions to reach a specific location, a host computer needs to obtain the IP address of another host to establish a connection, however, IP addresses consist of numerical sequences that are challenging to remember.

To address this issue, domain names were created to link these numerical IP addresses to easily memorable strings of characters. IP addresses are like a sign for a gourmet shop, while domain names represent the house number, and both can help customers locate the same store.

But while domain names are more memorable for humans, computers can't understand them. Therefore, the DNS was created to translate domain names into a machine-readable language so that website access can occur.

How Does DNS Work?

In the absence of cache, DNS usually needs to work together through 4 servers.

1. DNS Recursor: alias DNS Resolver, often managed by the user's ISP, handles incoming DNS queries, such as when a URL is entered into a browser, and then queries other 3 types of DNS servers to resolve the request.

2. Root Name Server: The resolver first queries the root name server, which is the first step in converting a domain name to an IP address. The root server replies to the resolver by offering the address of a Top-Level Domain DNS server, which manages domains under extensions like .com or .net, and holds the info for those domain names.

3. Top-level Domain Server: After getting the address, the resolver will query one TLD server. The TLD server will respond with the IP of an authoritative name server.

4. Authoritative Name Server: The server responds with the IP address of the source server after being queried by the resolver.

After the resolver receives the IP address of the source server, it will send it back to the client. The client will then use the IP address to find the source server directly and then the user will be able to access the site successfully.

What Is DNS Caching?

After DNS successfully retrieves the correct IP address of a target website, the resolver stores that address in its built-in cache and keeps it for a period of time.

During its storage period, if the resolver receives a request from a client based on the same domain name, it will not query the other three servers but will find the corresponding IP address directly from its cache to respond to the client. This is called DNS Caching.