Exclusive knowledge: How does DNS work?

  • by

Today, in this digital world, most of us deal with any website at least once in a day. In this situation it is important to know “How does DNS work?”.

What is DNS?

DNS or Domain Name Service translates a hostname (start-learning-online.com) into it’s computer-friendly IP address (for example An IP address is allocated to each device on the Internet, and that address is necessary to find the appropriate Internet device – like a street address is used to find a particular home. When a user wants to load a webpage, a translation must occur between what a user types into their web browser (start-learning-online.com) and the machine-friendly address necessary to locate the start-learning-online.com webpage.

How does DNS work?

In order to understand the process behind the DNS resolution, it’s important to learn about the different hardware components a DNS query must pass between.

For the web browser, the DNS lookup occurs “behind the scenes” and requires no interaction from the user’s computer apart from the initial request.

There are 4 DNS servers involved in loading a webpage:

DNS recursor

The recursor can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The DNS recursor is a server designed to receive queries from client machines through applications such as web browsers. Typically the recursor is then responsible for making additional requests in order to satisfy the client’s DNS query.

Root nameserver

The root server is the first step in translating (resolving) human readable host names into IP addresses. It can be thought of like an index in a library that points to different racks of books – typically it serves as a reference to other more specific locations.

TLD nameserver

The top level domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In example.com, the TLD server is “com”).

Authoritative nameserver

This final nameserver can be thought of as a dictionary on a rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor (the librarian) that made the initial request.

What are the steps in a DNS lookup?

For most situations, DNS is concerned with a domain name being translated into the appropriate IP address. To learn how this process works, it helps to follow the path of a DNS lookup as it travels from a web browser, through the DNS lookup process, and back again. Let’s take a look at the steps.

Note: Often DNS lookup information will be cached either locally inside the querying computer or remotely in the DNS infrastructure. There are typically 8 steps in a DNS lookup. When DNS information is cached, steps are skipped from the DNS lookup process which makes it quicker. The example below outlines all 8 steps when nothing is cached.

The 8 steps in a DNS lookup:

  1. A user types ‘start-learning-online.com’ into a web browser and the query travels into the Internet and is received by a DNS recursive resolver.
  2. The resolver then queries a DNS root nameserver (.).
  3. The root server then responds to the resolver with the address of a Top Level Domain (TLD) DNS server (such as .com or .net), which stores the information for its domains. When searching for example.com, our request is pointed toward the .com TLD.
  4. The resolver then makes a request to the .com TLD.
  5. The TLD server then responds with the IP address of the domain’s nameserver, example.com.
  6. Lastly, the recursive resolver sends a query to the domain’s nameserver.
  7. The IP address for example.com is then returned to the resolver from the nameserver.
  8. The DNS resolver then responds to the web browser with the IP address of the domain requested initially.

Once the 8 steps of the DNS lookup have returned the IP address for start-learning-online.com, the browser is able to make the request for the web page:

The browser makes a HTTP request to the IP address.

The server at that IP returns the webpage to be rendered in the browser.

To learn more such interesting technical topics like “How does DNS work?”, click here.

Click here to download DNS e-book pdf.

30 Interview Questions on DNS

  1. What is a Forward Lookup?
  2. What is the port no of DNS ?
  3. What is the main purpose of a DNS server?
  4. How does DNS work?
  5. What is a Resource Record?
  6. What is Reverse Lookup?
  7. What are the different DNS Roles?
  8. What is a Zone?
  9. SOA records must be included in every zone. What are they used for?
  10. What is primary, Secondary, stub & AD Integrated Zone?
  11. How do you manually create SRV records in DNS?
  12. How does DNS work? Explain the steps for DNS resolution.
  13. What are the benefits of using Windows 2003 DNS when using AD-integrated zones?
  14. What are the benefits and scenarios of using Stub zones?
  15. What are the benefits and scenarios of using Conditional Forwarding?
  16. What is the “in-addr.arpa” zone used for?
  17. What is Caching Only Server?
  18. What is forwarder?
  19. What is secondary DNS Server?
  20. What is SOA?
  21. What is a DNS query?
  22. What is the “.” zone in my forward lookup zone?
  23. Do I need to configure forwarders in DNS?
  24. How do I set up DNS for a child domain?
  25. What should I do if the domain controller points to itself for DNS, but the SRV records still do not appear in the zone?
  26. What are the properties of a Zone ?
  27. What are the requirements from DNS to support AD?
  28. What is DNS Spoofing?
  29. How can we prevent DNS spoofing?
  30. What is round-robin DNS and what is it’s purpose?

Do you want us to provide the answers of those above queries. Let us know through contact form.

Amazon Kinesis AMI Automation AWS AWS AppStream 2.0 AWS Backup aws certifications aws certifications catalog AWS EBS AWS Elastic Transcoder AWS IAM AWS Sagemaker aws services AWS SES aws support aws swf AWS WorkSpaces AWS X-Ray Azure Cost Management Best Practices chage command Linux Cloud Computing Cloud Migration Data Science DNS Edge Computing Fog Computing Interview Preparation Jenkins Kubernetes Linux Linux User Management Microsoft Azure OSI Model Python R sample questions Server Hardening Supercomputer WordPress