Skip to main content Link Search Menu Expand Document (external link)

How to Build DNS Server in X Programming Language

DNS stands for Domain Name Service which is like the phone book of the Internet. Users access the websites on the Internet through domain names while Web Browsers use IP addresses. DNS turns domain names into numerical IP addresses. For example, if user types example.com in a web browser, a server turns that human readable name to the attached IP address which looks like this 93.184.216.34.

Before DNS, Stanford Research Institute maintained a file named HOSTS.TXT. The file contained the host names and corresponding numerical address of the computers. As the Internet grew, maintaining a single centralised host file became cumbersome. In 1983, Paul Mockapetris created the Domain Name System which saw refinements over time[1].

Web browsing and other internet activities depend upon DNS to provide the relevant information required to connect users to remote hosts. DNS mapping is distributed in a hierarchy of authorities/zones which will be explained later when we get to the recursive DNS resolver.

This guide came into being as a goal to utilise free time and to understand DNS more deeply. The guides don’t describe the whole journey and obviously the server implementation is for educational purposes. Final goal is to implement the toy DNS server in multiple languages.

First language of choice is Javscript(Node JS)

Second language of choice is Ruby

Guides

Resources