DNS(Domain Name System)

DNS(Domain Name System)

We will examine how we can surf the internet without memorizing IP addresses.

When communicating devices on the Internet, they mainly communicate through IP addresses. An IP address is like identification. The path to follow when transferring data from one device to another is through IP addresses. Whether the data transfer is on the internet or via a direct ethernet connection, the IP address is always required. What does data transfer have to do with the internet?

Surf on the Internet, watch videos on youtube, see photos by involuntarily scrolling down on Instagram, etc. All you need is data. Videos, pictures, articles, everything we see is data. And since these data are not on our phone or computer, we request them from the other side. In other words, we request the photos on Instagram to be able to see them. They find the data recorded to their servers and send our device so we can see them. It is brief for data transferring.

Well, you have spent a lot of time on the internet. But if you have never used an IP address, to what do we owe it? Who finds IP addresses for us? The answer is DNS.

Until now, we have surfed the internet using domain names. In other words, when we type google.com to enter google, google came, we never used an IP address. We do not need to know an IP address, but our browsers that exchange data on our behalf need the IP address. There are DNS servers to match domain names with IP addresses. When we enter the domain name into our browser, our browser queries the IP address of the domain name from DNS servers. When the DNS responds with the registered address, requests from the browser go to that address.

Domain name (URL is entered actually) -> Browser (like Chrome, Firefox) -> DNS (finds IP from domain name) -> Browser (finds the target with the found IP and sends the request) -> Target

image.png

So is the DNS server just one? How can we get answers so quickly? The DNS server is not one, of course. There is even a hierarchy within themselves. To respond fast to requests, they handle requests in order by this hierarchy.

The browser checks itself before asking for DNS. It controls if there is an IP address belonging to the requested domain name in its cache (If it has previously queried and saved it to the local.) If there is, it has found the address it wants. But if not, it looks at the cache obtained from the inputs of other devices connected to the network. Otherwise, it requests an IP address from the root DNS servers.

Root DNS is responsible for finding out which TLD is responsible when the domain name arrives. Each TLD (Top Level Domain), such as .com, .me, .io, has its servers. After Root DNS tells which TLD server to go to, the relevant TLD server is queried, and the redirects are followed until the desired IP address is found. The IP address is accessed, and the browser receives the address and sends a request to the address found to communicate.

Browser -> Root DNS -> TLD Servers

image.png


If you need more information about IP or want to read more about the internet, you can check out the series below:

The subject of "How does DNS work?" is described as caricatured at the link below. It may be catchy if you like images:

howdns.works


Resources: