Journey TO DNS - Part 1

Ahmad Farag
tajawal
Published in
3 min readJul 28, 2018

The Domain Name System

The main points in this article :-

Funny Fact about DNS :

when you type www.google.com you actually going to page www.google.com.

there is a dot at the end of the domain 🙂 “give it a try …….”

where is the last dot represents the root of the internet’s NameSpace

What is DNS “Domain Name Server”?

Is like a phone book for the Internet, If you know a person’s name but don’t know their telephone number, you can simply look it up in a phone book.

DNS provides this same service to the Internet by mapping a domain name to IP Address.

For example, if someone types google.com DNS server will look inside its zone file then it will map a domain name to an IP address 216.58.207.14

and it sends it back to the browser.

Why DNS Is Important?

  • Web browsers interact through Internet Protocol (IP) addresses.
  • Elimination of the need for humans to memorize complex IP addresses.

The History Of DNS

Before DNS there was only single monolithic file “hosts.txt” mapping the names of all ARPANET’s hosts to their addresses.

Maintaining this file was a lot of hassle as

  • They only updated this file only twice a week.
  • Searching the file was linear O(n)
  • Latency and consistency

Then they started thinking about how to build DNS servers in the current structure.

DNS Hierarchy

The DNS hierarchy is comprised of the following elements:

1- Root Level

First step in resolving human readable host names into IP addresses

2- Top Level Domain Nameservers

Top Level Domains (TLD) are defined in the root domain, if These servers don’t have the information we need, but they can refer us directly to the servers that do have the information.

We have two kinds of TLD :-

Generic Top Level Domain (gTLD) : example edu, com, net, and mil

Country Code Top Level Domain(ccTLD) : for individual countries, For example, the us domain is affiliated with USA

3- Second Level Domains

is 3rd level in the hierarchical Domain Name System of the internet. It is directly below the TLD.

3- Sub-Domain

Sub domain is considered as the part of the second level domains

How does DNS work?

First, computer looks is its local DNS cache, which stores information that that computer has recently retrieved.

If computer has recently retrieved your computer doesn’t already know the answer, it needs to perform a DNS query to find out

computer queries Recursive DNS servers which have their own cache, if Recursive DNS servers don’t know the answer

they query Root nameservers

which look at the first part of domain example.com and direct query to TLD

Then, we have to go all the way back to the root name servers.

Then we ask the COM top level domain (TLD) nameservers that handle all the traffic for sites ending in .com

From here, the .com name servers identify what name servers example.com is a responsible for, If TLD nameservers don’t have the information we need it directs the query to authoritative nameserver which know all information about specific domain which are stored in DNS records, then it retrievesA record”.

Finally, the authoritative servers for example.com respond with the appropriate IP address for www.example.com.

References:-

--

--