Telegram- 👇 😉
Merion Mertics , ,


DNS: what is it and how it works?

Domain Name System


Hi! Does the IP address sound familiar to you? I bet it’s not! And guess what - for us, it’s not familiar as well. However, it’s one of the IP-addresses that your browser is trying to address when you are trying to reach Basically, you don’t have to memorize all of them due to the simple fact that it’s a duty of the DNS - Domain Name System.

The best example from real life is the contact list on your smartphone. Let’s take any random contact like "Mary Sharp Teeth from Tinder DON’T PICK UP" behind these meaningful words, some real phone number is hidden. But you never use a number, you always search for a person’s name that is easy to remember.

DNS servers are busy doing something like that - it just makes our life easier. In some sort of alternative reality with Skynet and masculine robots taking over the planet, it wouldn’t be necessary, as their memory is flawless.

Short video

Let’s take a look at the whole process

When you type in your browser, your computer wouldn’t reach a DNS server right away. Firstly, it will check your browser’s cache files. As it’s probably not the first time you have typed this site, it had some consequences: the record about this site is now in your cache, so the system won’t spend time and resources on sending packets back and forth.

But what if it’s actually a new website that you’ve never tried to access before? In this case, there will be a request sent to a resolver DNS server. Usually, such servers are located on your ISP premises, however, you’re free to choose any other DNS server. Quick examples are Google’s DNS ( and Cloudflare DNS (

DNS server will do a match between the website's name and its IP address in its cache. If there is a match, it will reply to us and if it’s not, the resolver will make a request to a root server.

DNS hierarchy

That’s a server that is placed above all other DNS servers, like a Shao Kahn in the DNS universe. But this server won’t tell us the IP address, it just will inform us about the right DNS server that has the required information. You can think about it as an administrator at the hotel reception.

That strange behavior is very useful - so it won’t try to find an exact IP address in a huge pile of other IP addresses, but rather narrow it down to a specific branch. Like in a bookstore - you won’t search for Stephen King’s book in a cooking literature section.

After that, it needs to send a request to a TLD - top-level domain server. Top-level domain servers are names that you see in a website’s name after the last dot - .com, .org, etc.

There are also Generic Top Level Domains (gTLD), that are not associated with any country: .edu (education), .com (commercial websites), .ai (artificial intelligence) and Country Code Top Level Domains (ccTLD) that are associated with certain country: .ru (Russia), .us (USA), .uk (United Kingdom).

So, the Root server gets the request from resolver: ‘What do you think about, buddy?’ And it answers: ‘Ask ccTLD server because it’s a .ru top-level-domain’

DNS root server redirects to ccTLD

Tired resolver now goes to ccTLD and asks him: "So, what next bro?" Further, he gets the direction to a lower level - an Authoritative nameserver, who'll say the correct IP-address. Yeah, success! Or not. He also might find nothing and reply to you like "Sorry, your website swallowed up by a black hole"

Now, Resolver will reply to your device that the website has a certain IP address. "Resolver also will put this address into its cache so it can skip that whole chain of activities".

There are three types of requests in the DNS universe:

  • Recursive: "Please send me the IP-address of"
  • Iterative: This query sounds like "Please send me the IP-address of or authoritative DNS server"
  • Inverse: kinda the same as Recursive, but other way around: "What is a domain name for this IP address?"

Now you know how DNS works, so please leave a comment below and tell us how many domains our IT wiki website has: