BSIT220 - Week 6 Posting - How does DNS work?

The Domain Name System (DNS) is a critical component of the Internet that helps translate human-readable hostname/domain names into machine-readable IP (Internet Protocol) addresses. It serves as a distributed database and a hierarchical naming system for mapping domain names to their corresponding IP addresses, and vice-versa. Without DNS, we would have to keep meticulous records of what IP addresses correspond to our favorite websites, and a lot of the web technologies in use today would have diminished features and capabilities.

So let's take a look at how a “simple” DNS request works :

The User Initiates a Request: When a user enters a domain name (e.g., into a web browser or any networked application, the application needs to determine the corresponding IP address to establish a connection. Hostnames are for humans. Computers talk to each other via IP Addresses (yes and MAC addresses, but that’s for another post).

Local DNS Cache Check: The first place the system checks is in the local DNS resolver cache, which stores previously resolved domain names and their corresponding IP addresses. If the desired domain name is found in the cache, the process is complete, and the IP address is used. This cache helps speed up the process since it is faster to access previously cached information than it is to repeat a query to a distant DNS server.

Recursive DNS Query: If the domain name is not found in the local cache, or if the previously cached record has expired, the user device contacts a recursive DNS resolver, which is typically provided by the Internet Service Provider (ISP) or a third-party DNS service like Google DNS (

Root Name Servers: If the recursive resolver does not have the requested information, it starts the DNS resolution process by contacting the root name servers. There are 13 sets of these root servers distributed worldwide, each identified by a letter (A through M) and managed by different organizations. This was done on purpose so that no one organization controls all of the DNS Root servers.

Top-Level Domain (TLD) Servers: The root name servers do not have information about specific domain names but can direct the resolver to the appropriate TLD server based on the top-level domain of the requested domain (e.g., .com, .org, .net). TLD servers are responsible for knowing the authoritative name servers for their respective TLDs. So in our example, a Root Name server would know who is the DNS for .com servers (the TLD) and the query would be routed to a server that can answer queries for the domain.

Authoritative Name Servers: The TLD server directs the resolver to the authoritative name server for the requested domain. Authoritative name servers are responsible for storing the DNS records for a specific domain. There may be multiple authoritative name servers for a single domain to provide redundancy and load balancing.

DNS Record Retrieval: The recursive resolver contacts the authoritative name server for the requested domain and asks for the specific DNS record associated with the domain name, such as an A record (IPv4 address) or AAAA record (IPv6 address). There are various types of DNS records, and the ones we are most interested in at the moment are:

A Record: The A record maps a hostname to an IP Address.
PTR Record: This record type maps an IP address to a hostname.
CNAME: This record maps a “nickname” to an A record.

CNAME records are particularly interesting because we use nicknames to access websites all of the time and never really think about it. For example, I could have a webserver called “” with a CNAME record that maps the nickname (or “alias”) “www” to the hostname (A record) webserver124. So when you access my webserver from the network, you use the Uniform Resource Locator (URL) instead of the real hostname which would look like this:”. So why wouldn’t we just set the hostname of the server to “www”? We certainly could do that, however if we wanted to host more than one function on a server, such as email, the server could have two CNAME records, “www” and “mail”, mapped to the same hostname. Also, if we want to move to another server, all we have to do is change the CNAME record and we are all set.

Response to Resolver: The authoritative name server responds to the recursive resolver with the requested DNS record(s). If multiple records are available (e.g., multiple IP addresses for load balancing), all relevant records are returned. Normally, you would only map one IP address to one hostname, but you could have a situation where multiple servers are sharing the work of hosting a website. So, one hostname could point to multiple IP addresses. But that’s a more complex scenario beyond the scope of this post.

The Resolver Caches Response: The recursive resolver caches the DNS response for a specified time period, known as the Time to Live (TTL), to speed up future requests for the same domain.

The User Application Uses the IP Address: With the IP address now available, the user's application (e.g., web browser) can establish a connection to the desired web server using the IP address. The DNS resolution process is complete.

DNS operates efficiently and quickly due to its distributed nature and the use of caching to reduce the need for repetitive queries. This hierarchical system ensures that DNS queries are resolved accurately and reliably across the internet. It also helps when the DNS server itself has the memory, CPU, and network resources to be able to handle many simultaneous queries.