Skip to main content

Everything about DNS servers 🌍

 > DNS (Domain Name System)

Introduction

Computers as we know communicate and work through binaries, these binaries can be represented in more ways than one such as hexadecimal or denary to mention a few. In a networking context, we have IP addresses that are given to nodes (PCs, smartphones, etc) allowing them to be individually identified within a network.

Purpose of a DNS

The majority of websites are hosted within a server or the cloud, when accessing their websites our web browser requires the IP address of that server to initiate communication with the target website. Since we know that IP addresses are nothing less than a group of 4 octets separated by a full stop 157.240.22.35, it's difficult for us to type http://157.240.22.35 in the web browser every time we need to access a website such as Facebook. It is this convenience that DNS provides. With the help of DNS, we can enter https://www.facebook.com/ without the need to remember the IP address of Facebook’s server.

img by:storyset,freepik

The DNS is simply the yellow pages of the internet. Consisting domain to IP address mappings along with other relevant information. We use this for resolving domain names to IP addresses.

DNS lookup → the process of translating a human-readable domain name (like "example.com") into an IP address (like "192.0.2.1") that web browsers use to identify the web server in the internet. This is done for the sole purpose of navigating through websites conveniently.

The DNS process occurs in 4 steps.



Client device → The first phase occurs when a domain name is searched such as amazon.com, which initiates a DNS query.

DNS resolver → Also known as the resolver server, which is responsible for receiving DNS queries, this server is run by your ISP.

DNS Lookup Process → This phase is executed by the DNS resolver server (your ISP). We will be talking more about this soon.

Response to client → Once the DNS resolver obtains the IP address it is relayed back to the client device.

How the DNS Lookup Process works

The DNS Lookup process takes into account a number of zones, (we will only be covering the essential zones) these elements will all add up at the end of the article. /keep reading/

Resolver (Step 1)

A DNS Resolver Server is run by your ISP, this device executes the DNS Lookup Process.

This is simply a server, responsible for receiving DNS queries, this also maintains a cache, to store commonly accessed domain names and their respective IP addresses. However, if they do not contain the requested domain’s IP addresses they will have to talk to the Root server.

The DNS resolver (ISP) contains the 13 server IP addresses, one of which will be used to communicate with the root server (more on this later)

(The Resolver Server is found as the Recursive resolver in the diagram)

img by : Zhou Li (Who Is Answering My Queries: Understanding and Characterizing Interception of the DNS Resolution Path), Research Gate

Root Server (Step 2)

The root zone represents the highest level in the DNS hierarchy, which contains information about the authoritative name servers for all the Top-Level Domains (TLDs).

This zone is occupied by devices known as root servers which serve the purpose of the root zone.

Their purpose is to provide the IP address and relevant information about the specific TLD, hence they act like the middlemen (Know that there are numerous TLDs for various websites thereby accessing a root server makes it easier for you to connect to the appropriate server).

These devices do not usually contain caches to store data about Domain names, since their primary objective is to bridge the gap between the resolver server and the TLD server.

The DNS architecture was built such that it requires 13 server addresses to be present at any one time. Therefore if one root server becomes unavailable there are 12 more to choose from. Back in the day, there used to be 1 server per IP address, however, in today’s time, each of the 13 IP addresses has several servers.

(Extra reading)

So this raises the question, how can several hundred root servers be occupying only 13 IP addresses? The DNS architecture consists of numerous technologies integrated one such is the DNS anycast, this technique enables us to represent a cluster of servers as 1 IP address hence we call it a server address.

Suppose we have 2 subdomains for a website such as customerservice.disney.com and blogs.disney.com. The company will set them for 2 different domains due that the customerserivce subdomain will require separate administration, but the blog page is more closely associated with disney.com and can be managed in the same zone as the primary domain. In this case, disney.com as well as the blog site would all be in one zone, while customerservice.disney.com would exist in a separate zone.

Hence there could be 2 zones from which the contents could be accessed, a common misconception is to associate a DNS zone with a domain name or a single DNS server. We need to understand that a DNS zone can contain multiple subdomains and multiple zones can exist in the same server. DNS zones aren’t necessarily separated from one another (physically), moreover zones are strictly used for delegating control.

Top Level Domain Server (Step 3)

This server stores information about domain names at the highest level of the DNS hierarchy, the TLD server holds authoritative information for domain names within its respective top-level domain, such as .com, .org, .net, .gov, and country-code TLDs like .uk, .de, .jp, etc.

Thereby if we want to access disney.com, the TLD server will redirect the resolver server with the IP address of the respective Authoritative Name Server.

Authoritative Name Server (Step 4)

This is responsible for knowing everything including the IP address of the domains & holds all the records. Once the domain name is matched with the IP, the IP address will be used and relayed back to the resolver server which in turn returns to the client, enabling the client to access the web pages respectively.

With step 4 completed we now have a general understanding of how the DNS operates...


## ADIOS AMIGOS ##

Comments

Popular posts from this blog

Bricks Heist CTF Write-Up 🧱

  > TryHack3M: Bricks Heist ( TryHackMe) Before beginning we need to edit our /etc/hosts file which makes it easier to use the target machine during scanning and exploitation phases.  The /etc/hosts file serves as the first source of hostname-to-IP address mappings before accessing the DNS servers. sudo vim /etc/hosts Thereby if we include our attackbox IP as bricks.thm whenever we access https://bricks.thm in our we browser the atttackbox IP is mapped accordingly. Reconnaissance Nmap We will begin the box by setting up an nmap scan to identify the vulnerable services running on the ports. nmap -sC -sN -oN initialNmap <TARGET-IP> -sC → Default script scanning -sN → This flag specifies a TCP NULL scan. This technique is used to determine whether the ports are open, closed, or filtered by observing the response behavior of the target system. -oN → Instructs Nmap to save the output by this file name The output of this scan does not help us much. When we access the sit...

Sub-Netted 🪐

> Subnetting Explained Introduction Simplified Subnetting , Let’s untangle the knots and dive into the world of networks. Isn't it strange to see the IPv4 address of your laptop and IPv4 address you see on google are actually different ? (img by freepik - vectorsclub) Identification used in the interconnected network. A school identifies their students from admission numbers. Each person has different telephone numbers. Houses have addresses. “Ah Ha, this all revolves around a primary key”. That’s the identification. Likewise the internet has IPv4 addresses. Although they are running out. Incredibly fast… The bearer of IP addresses Routers as we all know are middlemen. These devices are configured by ISP’s in your houses or office, to provide a connection, which enable devices to communicate with the internet, and browse various sources such as Netflix, or eBay. So where’s your IP address ? When you connect to a network such as your home Wi-Fi, each device is provided an IP a...