How DNS Works?

Home / How DNS Works?

How DNS Works?

December 9, 2015 | Article | No Comments

Computer / machine only recognize numbers and all data are stored as symbols. However human tends to easily recognize information in format of name. Instead of IP address such as 167.205.1.34, people can remember name such as itb.ac.id. Therefore, to bridge two different system, a DNS is created.

DNS is a server for translating name in human representation to number (IP address) which is known by computer.

DNS is a distributed database in the purpose of identifaction and naming nodes on Internet. The term distributed in this concept refer to the concept that DNS server only store hostnames or computers or nodes under its authorities only. DNS will not store information of nodes for domain which doesn’t belong to its authority.

For example:

Let say there is a DNS server on domain xathrya.id. This server will store name on its network. The network can be its subdomain which can be accessed outside of network. The subdomain for instance: mail.xathrya.web.id, wiki.xathrya.web.id, labs.xathrya.web.id, etc. A DNS also can store information of node inside a network. Naming resource such as switch, router, etc. This resource is private inside of network and cannot be seen by outside.

Hierarchy and Tree

As distributed system, there are many DNS server which has authorities for their domain. They are independent and autonomous. However, every DNS server is interconnect to each other and create a large internet connection. They are exchanging information since no DNS server know every nodes in the world.

DNS servers in the world are forming great tree and each node is located hierarchically. When DNS server doesn’t have name in its authority, they will ask other DNS server which might know. In the root there is a node referred as root DNS.

Searching Operation

When a computer inside of network want to visit a page / domain (for example: https://blog.xathrya.id) it should contact nearest DNS server. This operation is known as resolving domain name.

The DNS server is must be assigned on each machine. If a machine connect to DHCP network, it can acquired address of DNS server automatically. We can also set DNS server manually, depend on our Operating System.

When a machine ask DNS server for a name, there are two possibilities. The server knows the address of asked name, thus the name / domain is under its authority. If this happens, DNS directly reply and giving the IP address or information of that name.

But when DNS can’t resolve the name, it will begin search operations. The operation is described as below:

  1. Local DNS will asks root DNS about address of DNS server which have authorities on .id domain.
  2. root DNS will gives answer local DNS about DNS server which have authority on .id domain. Let say this domain is idDNS. Now we got information of idDNS and get partial name .id.
  3. Local DNS will asks idDNS about the DNS server which have authority on xathrya.id domain. Let say this domain is xathryaDNS. Now we got information of xathryaDNS and get partial name xathrya.id.
  4. Local DNS sucessfully get address of xathrya.id, it will then answer the client and gives IP address of xathrya.id.

When DNS get a new name, it can cache the name for some period of time. The caching mechanism will be discussed on other article.

Suppose our domain name is more than that level? Perhaps, we have a domain xathrya.web.id need to be resolved then the steps would be:

  1. Local DNS will asks root DNS about address of DNS server which have authorities on .id domain.
  2. root DNS will gives answer local DNS about DNS server which have authority on .id domain. Let say this domain is idDNS. Now we got information of idDNS and get partial name .id.
  3. Local DNS will asks idDNS about the DNS server which have authority on web.id domain. Let say this domain is webidDNS. Now we got information of webidDNS and get partial name .web.id.
  4. Local DNS will asks webidDNS about the DNS server which have authority on xathrya.web.id domain. Let say this domain is xathryaDNS. Now we got information of xathryaDNS and get partial name xathrya.web.id.
  5. Local DNS sucessfully get address of xathrya.web.id, it will then answer the client and gives IP address of xathrya.web.id.

As seen, when we have deeper name we need more steps to resolve it.

,

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial