DNS basics

sumitnegi

Sumit Negi

Posted on February 6, 2024

DNS basics

What is DNS?

Domain Name System which translates the human friendly hostnames into the machine IP addresses

Each device connected to the Internet has a unique IP address which other machines use to find the device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).

DNS Terminologies

• Domain Registrar : Amazon Route 53, GoDaddy,namecheap …
• DNS Records: A, AAAA, CNAME, NS, …
• Zone File: contains DNS records
• Name Server : resolves DNS queries (Authoritative or Non-Authoritative)
• Top Level Domain (TLD): .com, .us, .in, .gov, .org, …
• Second Level Domain (SLD): amazon.com, google.com
Image description

There are 4 DNS servers involved in loading a web page:

Here's a simplified explanation of the terms:

  1. DNS recursor: It's like a librarian who helps you find a book in a library. When you ask for a webpage, your device talks to the DNS recursor, which then searches for the webpage's location.

  2. Root nameserver: This is the first place the DNS recursor goes to find the address of a webpage. It's like the index in a library that shows where different sections of books are located.

  3. TLD nameserver: It's like a specific section of books in a library. When the root nameserver points to a TLD nameserver, it's like finding a specific section of books related to a certain topic, such as ".com" websites.

  4. Authoritative nameserver: Think of it as a dictionary on a shelf of books. It's the final place the DNS recursor checks to find the exact address of the webpage you're looking for. If it finds the address, it tells the DNS recursor, which then gives you the webpage's location.

In simpler terms, an authoritative DNS server and a recursive DNS resolver play different roles in the DNS system.

  • Recursive DNS resolver: This is like a detective that helps you find information. When you type a web address into your browser, the recursive resolver starts looking for the address. It asks other servers for help until it finds the right one. Sometimes, it already knows where to look because it remembers previous searches (caching).

  • Authoritative DNS server: This is like the ultimate source of information. It's the server that actually has the address you're looking for. When the recursive resolver finally finds the right server, that server gives it the exact address you need. This is what allows your browser to find and display the website you want to visit.

Cloudflare, for example, not only provides recursive DNS resolver services like Google DNS or OpenDNS but also hosts infrastructure-level authoritative nameservers, like the F-root server network. These authoritative nameservers are essential for handling vast amounts of DNS traffic and ensuring the smooth functioning of the Internet.

There are the simplified steps in a DNS lookup:

  1. A user types a website name (like example.com) into a web browser.
  2. The request travels to a DNS resolver.
  3. The resolver asks a root nameserver for help.
  4. The root nameserver points the resolver to a TLD (like .com).
  5. The resolver asks the TLD server for the domain's nameserver.
  6. The TLD server gives the resolver the nameserver's IP address.
  7. The resolver queries the domain's nameserver.
  8. The nameserver provides the IP address for the website.
  9. The resolver sends the IP address back to the web browser.

These steps allow the web browser to find the correct IP address for the requested website.

After obtaining the IP address for example.com through the DNS lookup process, the browser proceeds with the following steps to fetch the webpage:

  1. The browser sends a HTTP request to the obtained IP address.
  2. The server located at that IP address responds by sending the webpage content back to the browser.
  3. The browser then renders and displays the webpage for the user to interact with.

Image description

💖 💪 🙅 🚩
sumitnegi
Sumit Negi

Posted on February 6, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related