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 192.168.1.1). 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:
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.
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.
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”).
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:
- 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.
- The resolver then queries a DNS root nameserver (.).
- 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.
- The resolver then makes a request to the .com TLD.
- The TLD server then responds with the IP address of the domain’s nameserver, example.com.
- Lastly, the recursive resolver sends a query to the domain’s nameserver.
- The IP address for example.com is then returned to the resolver from the nameserver.
- 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
- What is a Forward Lookup?
- What is the port no of DNS ?
- What is the main purpose of a DNS server?
- How does DNS work?
- What is a Resource Record?
- What is Reverse Lookup?
- What are the different DNS Roles?
- What is a Zone?
- SOA records must be included in every zone. What are they used for?
- What is primary, Secondary, stub & AD Integrated Zone?
- How do you manually create SRV records in DNS?
- How does DNS work? Explain the steps for DNS resolution.
- What are the benefits of using Windows 2003 DNS when using AD-integrated zones?
- What are the benefits and scenarios of using Stub zones?
- What are the benefits and scenarios of using Conditional Forwarding?
- What is the “in-addr.arpa” zone used for?
- What is Caching Only Server?
- What is forwarder?
- What is secondary DNS Server?
- What is SOA?
- What is a DNS query?
- What is the “.” zone in my forward lookup zone?
- Do I need to configure forwarders in DNS?
- How do I set up DNS for a child domain?
- What should I do if the domain controller points to itself for DNS, but the SRV records still do not appear in the zone?
- What are the properties of a Zone ?
- What are the requirements from DNS to support AD?
- What is DNS Spoofing?
- How can we prevent DNS spoofing?
- 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