Christmas Offer - Every Learner Must Check Out - Flat 88% OFF on All Access Pass
00
days
:
00
hours
:
00
minutes
:
00
seconds
PyNet Labs- Network Automation Specialists

What is DNS in Computer Networks?

Author : Pankaj Kumar
Last Modified: February 27, 2024 
What is DNS in Computer Networks Featured Image

Introduction

The Internet is an extensive network of connected devices, each with an individual identification number known as an IP address. People find it extremely challenging to memorize numbers, especially since IP addresses are dynamic and can change over time. As a result, a mapping is needed to convert a website’s domain name, such as www.google.com, to its corresponding IP address, like 142.250.74.196.

Domain Name System (DNS) is a service that offers this mapping. In this blog post, we will discuss DNS in computer networks, its history, purpose, and how DNS works.

Before getting into more details, let’s first define DNS in computer networks.

What is DNS in Computer Networks?

DNS, or Domain Name System, is a hierarchical naming system that allows communication across devices on a network. It generally translates human-readable domain names to computer-friendly Internet Protocol (IP) addresses. It additionally offers information associated with domain names, such as mail servers, name servers, and authoritative resources.

DNS is a distributed database implemented in a hierarchy of name servers. A name server is a machine that stores and responds to queries about domain names and IP addresses. There are various types of name servers, which include root name servers, top-level domain (TLD) name servers, and authoritative name servers.

DNS Structure

A domain name consists of a URL comprising several parts called labels. The hierarchy of domains is read from right to left, with each section representing a subsection. After the period, the TLD is shown in the domain name. There are many top-level domains like .com, .org and .edu, and many more. Additionally, some domains show a country code or geographic location, such as .us for the United States and .ca for Canada.

On the left, each label represents another subdomain of the domain on the right. For example, in the URL www.pynetlabs.com, “pynetlabs” is a subdomain of .com and “www” is a subdomain of pynetlabs.com.

Subdomains can have up to 127 levels; each label can contain up to 63 characters. Total domain character length can be up to 253 characters, and some other rules include not starting or ending labels with hyphens and not having full numeric TLD names.

The rules for executing domain names in Request for Comments (RFC) 1035 are in the Internet Engineering Task Force (IETF).

History of Domain Name System

When we talk about the history of DNS, we talk about the early days of the Internet when hosts were identified by their hostnames. All these hostnames were stored in a file commonly known as HOSTS.TXT. But as the number of users grew with time, so did the hosts, and it became difficult as well as impractical to manage the host file, which is too large. This will directly impact the consistency and accuracy across all hosts.

In order to overcome these limitations, Domain Name System, was introduced in 1983. It is a hierarchical structure for domain names where each level is separated by a dot, for example, google.com.

After its introduction to the Internet era, DNS in computer networks has evolved with new features and functionalities for better functioning. Some of the milestones have been discussed below:

  • In 1987, the first edition of RFC 1034 and RFC 1035 was published, which included new specifications and is known to be the base of DNS used today.
  • After 1987, the Internet Corporation for Assigned Names and Numbers (ICANN) was developed in order to coordinate the global management of domain names and IP addresses.
  • Lastly, in 2003, the Domain Name System Security Extensions (DNSSEC) was introduced to provide cryptographic authentication and integrity for DNS data.

Now that we know the history of DNS, let’s discuss the purpose of DNS in detail.

Purpose of DNS in Computer Networks

DNS serves several purposes for the functioning of the Internet. Some of them are:

  • It offers a user-friendly way to access websites and other online services by way of using meaningful names in preference to numerical addresses.
  • It enables scalability and decentralization of the Internet by permitting any host to join or leave the network without affecting other hosts.
  • It also supports load balancing and fault tolerance by distributing requests amongst multiple servers that host the same domain name.
  • It allows mobility and dynamic addressing by way of allowing hosts to change their IP addresses without changing their domain names.
  • It permits interoperability and compatibility among various applications and protocols that use domain names for communication.

Let’s understand the workings of DNS in computer networks.

How does DNS work?

Domain Name System (DNS) works the same as a client-server model in which a DNS client sends a query to a DNS server and in return the DNS server sends back the requested information to the client. When we talk about a query, it is the request that the client made to the server side. A response is the solution to the query that the server sends to the client.

How DNS Works

The process of finding the IP address for a domain or website is commonly known as DNS lookup. A DNS lookup generally involves various steps and working closely with several name servers. Below, we have explained the functioning of DNS lookup.

  • Firstly, the user or a client enters a website or domain name in their browser.
  • Once the user sends a request, the browser contacts a local resolver, also known as a DNS resolver. It is a software component that mainly manages the DNS queries requested by the client. The resolver checks its cache to see if it already has the solution to the query. If not, it proceeds to the next step.
  • After that, the root name server searches for its database to find which TLD name server is responsible for the domain name in the query requested by the client. The root name servers are mainly responsible for the top-level domain. For example, if you search for google.com, then the root name servers send a list of all name servers associated with .com.
  • Once the root name server generates a list of all possible domains, the .com TLD name server checks its database to look at the authoritative name server. For example, if you search for www.google.com, the .com TLD name server will return the IP associated with the google.com authoritative name server.
  • The authoritative name server checks its database to see if it has the solution that is required for the query asked by the client side. This name server is mainly responsible for returning the IP address of the domain name to the resolver. For example, if the query is for ww.google.com, the authoritative name server returns 142.250.72.36 back to the resolver and, at the end, to the client, and only then it is possible to establish a connection with the host at that address.

We have explained the functioning of DNS.

What is DNS Lookup?

DNS lookup, or we can say DNS resolution, refers to the process that allows applications and systems to convert readable domain names into corresponding IP addresses used by computers to communicate over the Internet.

What is DNS Resolver?

DNS resolvers, commonly known as DNS clients, have the functionality to look up the DNS or initiate the process of DNS resolution. DNS resolver allows applications to quickly access various websites and services available on the Internet through user-friendly domain names also solves the problem of remembering IP addresses.

Now, let’s understand the different types of DNS servers.

Different Types of DNS Servers

The hierarchy consists of four levels of name servers. These are:

  1. Local name servers: These mainly deal with the requests or queries from the clients or hosts in a network, such as web browsers. They do not store any domains or IP addresses, but they cache the results of previous queries for faster responses. They additionally forward the queries to other name servers if they cannot solve them locally.
  2. Root name servers: These are the top-level name servers that can be contacted through different name servers that cannot resolve a website name. They do not store any domain names or IP addresses; however, they know the authoritative name servers for all the top-level domain names (TLDs), including .com, .Org, .Edu, etc. There are thirteen root name servers globally recognized by using letters A to M. They are distributed across numerous locations and operated by means of different organizations.
  3. Top-level domain (TLD) name servers: These are accountable for managing the second-level domain names under a specific TLD, consisting of google.com, xyz.org, stanford.edu, and so on. They do not store any domains or IP addresses, but they realize the authoritative call servers for every second-level domain under their TLD.
  4. Authoritative name servers: These are responsible for storing and providing the authoritative mappings between domain names and IP addresses for a selected domain or subdomain, such as www.google.com, cs.stanford.edu, and so forth. They are typically maintained by means of the groups or organizations that own or operate those domains or subdomains.

Types of DNS Queries

DNS queries are the requests that clients send to DNS servers to resolve domain names. There are three main types of DNS queries, these are:

Recursive DNS Query

Recursive queries are the simplest of all DNS query types. They occur when a user asks a DNS server to resolve a website or domain name, and the server either comes up with a solution or, if not, contacts other servers until it finds the solution. The server then returns the answer to the query to the client in a single response. Recursive queries are convenient for clients; however, they place a lot of loads on DNS servers.

Recursive DNS Query

Iterative DNS Query

Iterative queries are complex as compared to recursive queries. They arise when a client asks a DNS server to resolve a website or domain name, and the server no longer understands the answer but is aware of any other server that would have a solution to the client’s query. The server then returns a referral to the client, pointing to any other server that is closer to the answer.

The client then repeats the query with the new server, and this manner is maintained till the client reaches the authoritative server that is aware of the solution. Iterative queries are more efficient for DNS servers; however, they require more work from clients.

Iterative DNS Query

Non-Recursive DNS Query

Non-recursive queries are the rarest kind of DNS queries. They occur when a user asks a DNS server to resolve a website or domain name, and the server either knows the answer to the request or query made by the client and, if not, sends it to other servers for the solution. The server then returns the answer or an error to the client without contacting any other server. Non-recursive queries are helpful for testing or debugging purposes but are not very common in regular operations.

These are the three kinds of DNS Queries.

What is DNS Caching?

DNS caching allows one to get the answer to a DNS query in less time. DNS keeps previous answers to customers’ queries nearby and will enable them to get the same information faster the next time they query.

Here are some familiar places where DNS data may be cached:

  • Browser: DNS data is cached for a set period by default by many browsers, such as Apple Safari, Google Chrome, and Mozilla Firefox. When a DNS request is received to a local DNS resolver server before the request leaves the machine, it is the first cache verified by the browser.
  • Operating System (OS): Most OSes include a built-in DNS resolver known as a stub resolver that caches DNS data and handles queries before sharing it with an external server. The OS is usually queried after the browser or other query application.
  • Recursive resolver: On DNS recursive resolution, the answer to a DNS query may also be cached. In the response, the resolution contains some essential records, and some steps in the DNS resolution process may be missed. For example, when the resolver includes an A record but not an NS record, the resolver and the TLD server can skip the root server and can be queried without deviation.

Frequently Asked Questions

Q1. What is DNS and uses?

DNS, or domain name system, specifically turns domain names into IP addresses, allowing users to reach the websites they requested. With DNS, it is easier for users to access websites without even memorizing the numbers or IP addresses.

Q2. What is the DNS hostname?

A DNS hostname is a name that identifies a device on a network. For example, xyz.com is a DNS hostname.

Q3. What is an example of a DNS?

An example of a DNS is www.pynetlabs.com.

Q4. What is the port number of DNS?

The port number of DNS is 53. This means that when a computer wants to resolve a domain name to an IP address, it sends a query to a DNS server on port 53.

Conclusion

DNS is a crucial component in computer networks that enables communication across devices on the Internet. It provides a user-friendly way to access websites and other online services by using meaningful names instead of numerical addresses. In this blog, we have discussed DNS in computer networks in detail, along with its functioning and different types of DNS servers.

DNS is an important topic in the CCNA Training. If you are preparing for CCNA Certification, then you need to master Domain Name System.

Recent Blog Post

Leave a Reply

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

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram