Urgent.News

What's breaking now, across thousands of outlets.

Tech

Networking Basics: IP Address ও DNS

Let's consider a simple example that we encounter in our everyday life. Imagine you are visiting a friend's house for the first time. Instead of saying, "I want to visit my friend Leo's house," you look up the exact address on Google Maps, such as House 69, Road 09, New Street, NY. This is because you need an exact location to find someone, unlike just knowing their name.

Similarly, the Internet's DNS system works in the same way. When you open the Instagram app, your phone doesn't know where Instagram's server is. It needs an exact location, which is the IP Address. What is an IP Address? An IP Address is a unique location for every device/server on the Internet. For example, 142.250.183.14 (IPv4).

It looks like a house address, just written with numbers. IP Addresses are mainly of two types: IPv4 and IPv6. Let's compare these two:

IPv4: 142.250.183.14 - This format uses four numbers, each between 0-255, creating a total of 4.3 billion unique addresses. However, the world is now facing a critical problem: too many people and devices (phones, laptops, smart TVs, IoT devices) have exceeded this 4.3 billion limit, leading to the near exhaustion of IPv4 addresses. IPv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 - This format is much longer, creating a much larger number of possible combinations (340 undecillion!), enough to last for thousands of years.

A simple analogy to understand this is that IPv4 is like Earth, where population is increasing but land is not, while IPv6 is like a galaxy, with new galaxies being discovered every day, almost infinite.

Another important aspect in system design is Public and Private IP Addresses. This is easy to understand - public means accessible to everyone, while private means restricted. So, why do we need DNS? The main point is that we humans never remember IP addresses. We don't browse with 142.250.183.14; we type google.com. So, how does Google find its IP Address?

This is where DNS comes in. DNS is like a phone book for the Internet. Just as we save our friends' phone numbers by their names, we type google.com. Then, the question arises, how does Google find its IP Address? This leads us to DNS. DNS (Domain Name System) is like the Internet's phone book. Just as we save our friends' phone numbers by their names, we type google.com.

DNS then converts this name into an IP Address - this whole process is called DNS Resolution. How does DNS Resolution work (when you type instagram.com)? When you type instagram.com in your browser, your device first checks if it has the name in its cache. If not, it sends a request to the DNS Resolver (usually the server provided by your ISP).

The Resolver then asks the root server (where it finds the information), which tells it the location of the TLD Server (for .com, this would be TLD Server). The TLD Server then tells it the Authoritative Server's location, which holds the actual IP Address. The Resolver then sends this IP to your browser, which then sends a request to this IP, and Instagram loads.

It might seem like a long process, but it actually happens in just a few milliseconds. DNS Record Types DNS can host many types of data, each serving a different purpose - A Record: Domain → IPv4 Address (like house address); CNAME: Domain → Another Domain (Alias) (like renaming a house), MX Record: Determines where email goes - like deciding where to send a letter; DNS Caching and TTL - When you type instagram.com repeatedly, it's inefficient to follow the entire process each time.

That's why browsers cache DNS results for a certain period (TTL - Time To Live), like storing the result for 1-2 hours or a few minutes. DNS Load Balancing (GeoDNS) is an interesting topic - platforms like Instagram don't use just one server. They use servers all around the world. GeoDNS returns the IP of the server closest to your location when you browse instagram.com, which makes your experience faster and more reliable.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 9 September →