The Wayback Machine - https://web.archive.org/web/20241115030956/https://www.geeksforgeeks.org/domain-name-system-dns-in-application-layer/
Open In App

Domain Name System (DNS) in Application Layer

Last Updated : 27 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The Domain Name System (DNS) is like the internet’s phone book. It helps you find websites by translating easy-to-remember names (like www.example.com) into the numerical IP addresses (like 192.0.2.1) that computers use to locate each other on the internet. Without DNS, you would have to remember long strings of numbers to visit your favorite websites.

Domain Name System (DNS) is a hostname used for IP address translation services. DNS is a distributed database implemented in a hierarchy of name servers. It is an application layer protocol for message exchange between clients and servers. It is required for the functioning of the Internet.

What is the Need for DNS?

Every host is identified by the IP address but remembering numbers is very difficult for people also the IP addresses are not static therefore a mapping is required to change the domain name to the IP address. So DNS is used to convert the domain name of the websites to their numerical IP address.

DNS translates domain names to IP addresses, making it an essential part of the internet. To learn more, the GATE CS Self-Paced Course is a great resource.

Types of Domain

There are various kinds of domains:

  • Generic Domains: .com(commercial), .edu(educational), .mil(military), .org(nonprofit organization), .net(similar to commercial) all these are generic domains.
  • Country Domain: .in (India) .us .uk
  • Inverse Domain: if we want to know what is the domain name of the website. IP to domain name mapping. So DNS can provide both the mapping for example to find the IP addresses of geeksforgeeks.org then we have to type

nslookup www.geeksforgeeks.org

Types of DNS

Types of DNS

Organization of Domain

It is very difficult to find out the IP address associated with a website because there are millions of websites and with all those websites we should be able to generate the IP address immediately, there should not be a lot of delays for that to happen organization of the database is very important.

Root DNS Server

Root DNS Server

  • DNS Record: Domain name, IP address what is the validity? what is the time to live? and all the information related to that domain name. These records are stored in a tree-like structure.
  • Namespace: Set of possible names, flat or hierarchical. The naming system maintains a collection of bindings of names to values – given a name, a resolution mechanism returns the corresponding value.
  • Name Server: It is an implementation of the resolution mechanism.
DNS = Name service in Internet – A zone is an administrative unit, and a domain is a subtree. 

Name-to-Address Resolution

The host requests the DNS name server to resolve the domain name. And the name server returns the IP address corresponding to that domain name to the host so that the host can future connect to that IP address.

Name to Address Resolution

Name-to-Address Resolution

  • Hierarchy of Name Servers Root Name Servers: It is contacted by name servers that can not resolve the name. It contacts the authoritative name server if name mapping is not known. It then gets the mapping and returns the IP address to the host.
  • Top-level Domain (TLD) Server: It is responsible for com, org, edu, etc, and all top-level country domains like uk, fr, ca, in, etc. They have info about authoritative domain servers and know the names and IP addresses of each authoritative name server for the second-level domains.
  • Authoritative Name Servers are the organization’s DNS servers, providing authoritative hostnames to IP mapping for organization servers. It can be maintained by an organization or service provider. In order to reach cse.dtu.in we have to ask the root DNS server, then it will point out to the top-level domain server and then to the authoritative domain name server which actually contains the IP address. So the authoritative domain server will return the associative IP address.

Domain Name Server

The client machine sends a request to the local name server, which, if the root does not find the address in its database, sends a request to the root name server, which in turn, will route the query to a top-level domain (TLD) or authoritative name server. The root name server can also contain some hostName to IP address mappings. The Top-level domain (TLD) server always knows who the authoritative name server is. So finally the IP address is returned to the local name server which in turn returns the IP address to the host.

Domain Name Server

Domain Name Server

How Does DNS Work?

The working of DNS starts with converting a hostname into an IP Address. A domain name serves as a distinctive identification for a website. It is used in place of an IP address to make it simpler for consumers to visit websites. Domain Name System works by executing the database whose work is to store the name of hosts which are available on the Internet. The top-level domain server stores address information for top-level domains such as .com and .net, .org, and so on. If the Client sends the request, then the DNS resolver sends a request to DNS Server to fetch the IP Address. In case, when it does not contain that particular IP Address with a hostname, it forwards the request to another DNS Server. When IP Address has arrived at the resolver, it completes the request over Internet Protocol .

For more, you can refer to Working of DNS Server .

How-DNS-Works

How Does DNS Works?

Authoritative DNS Server Vs Recursive DNS Resolver

Parameters

Authoritative DNS Server

Recursive DNS Resolver

Function

Holds the official DNS records for a domain

Resolves DNS queries on behalf of clients
Role Provides answers to specific DNS queries Actively looks up information for clients
Query Handling Responds with authoritative DNS data Queries other DNS servers for DNS data
Client Interaction Doesn’t directly interact with end-users Serves end-users or client applications
Data Source Stores the DNS records for specific domains Looks up data from other DNS servers
Caching Generally, doesn’t perform caching Caches DNS responses for faster lookups
Hierarchical Resolution Does not participate in the recursive resolution Actively performs recursive name resolution
IP Address Has a fixed, known IP address IP address may vary depending on ISP
Zone Authority Manages a specific DNS zone (domain) Does not manage any specific DNS zone

What is DNS Lookup?

DNS Lookup or DNS Resolution can be simply termed as the process that helps in allowing devices and applications that translate readable domain names to the corresponding IP Addresses used by the computers for communicating over the web.

What Are The Steps in a DNS Lookup?

Often, DNS lookup information is stored temporarily either on your own computer or within the DNS system itself. There are usually 8 steps involved in a DNS lookup. If the information is already stored (cached), some of these steps can be skipped, making the process faster. Here is an example of all 8 steps when nothing is cached:

  1. A user types “example.com” into a web browser.
  2. The request goes to a DNS resolver.
  3. The resolver asks a root server where to find the top-level domain (TLD) server for .com.
  4. The root server tells the resolver to contact the .com TLD server.
  5. The resolver then asks the .com TLD server for the IP address of “example.com.”
  6. The .com TLD server gives the resolver the IP address of the domain’s nameserver.
  7. The resolver then asks the domain’s nameserver for the IP address of “example.com.”
  8. The domain’s nameserver returns the IP address to the resolver.
Working-of-DNS

Working of DNS

DNS Servers Involved in Loading a Webpage

Upon loading the webpage, several DNS Servers are responsible for translating the domain name into the corresponding IP Address of the web server hosting the website. Here is the list of main DNS servers involved in loading a Webpage.

  • Local DNS Resolver
  • Root DNS Servers
  • Top-Level Domain (TLD) DNS Servers
  • Authoritative DNS Servers
  • Web Server

This hierarchical system of DNS servers ensures that when you type a domain name into your web browser, it can be translated into the correct IP address, allowing you to access the desired webpage on the internet.

For more information you can refer DNS Look-Up article.

What is DNS Resolver?

DNS Resolver is simply called a DNS Client and has the functionality for initiating the process of DNS Lookup which is also called DNS Resolution. By using the DNS Resolver, applications can easily access different websites and services present on the Internet by using domain names that are very much friendly to the user and that also resolves the problem of remembering IP Address.

What Are The Types of DNS Queries?

There are basically three types of DNS Queries that occur in DNS Lookup. These are stated below.

  • Recursive Query: In this query, if the resolver is unable to find the record, in that case, DNS client wants the DNS Server will respond to the client in any way like with the requested source record or an error message.
  • Iterative Query: Iterative Query is the query in which DNS Client wants the best answer possible from the DNS Server.
  • Non-Recursive Query: Non-Recursive Query is the query that occurs when a DNS Resolver queries a DNS Server for some record that has access to it because of the record that exists in its cache.

What is DNS Caching?

DNS Caching can be simply termed as the process used by DNS Resolvers for storing the previously resolved information of DNS that contains domain names, and IP Addresses for some time. The main principle of DNS Caching is to speed up the process of future DNS lookup and also help in reducing the overall time of DNS Resolution.

Conclusion

In conclusion, the Domain Name System (DNS) is an essential part of the application layer in networking. It acts like the internet’s directory, translating human-friendly domain names into numerical IP addresses that computers use to communicate. Without DNS, navigating the internet would be much more difficult, as we’d need to remember complex IP addresses for every website. DNS makes the internet user-friendly and efficient, allowing us to easily access websites and online services by using simple, memorable names.

Frequently Asked Questions on Domain Name System(DNS) – FAQs

What do you mean by level 3 DNS Server?

Level 3 can be termed as a third-party DNS Server that is completely free and open to the public.

Is Domain Name System (DNS) a protocol?

Domain Name System (DNS) is a protocol that is used to convert easily readable names for communicating over the network, instead of remembering IP Address.

How can you categorize a DNS as a TCP or UDP?

DNS is designed to be used in both the ways like as a TCP or as a UDP. It converts to TCP when it is not able to communicate on UDP.



Previous Article
Next Article

Similar Reads

Dynamic Domain Name System (DDNS) in Application Layer
When DNS (Domain Name System) was designed, nobody expected that there would be so many address changes such as adding a new host, removing a host, or changing an IP address. When there is a change, the change must be made to the DNS master file which needs a lot of manual updating and it must be updated dynamically. Dynamic Domain Name System (DDN
4 min read
Domain Name System (DNS) Zones
Domain Name System (DNS) is divided into many multiple various zones. These zones distinguish between specifically managed areas within DNS namespace.  Domain Name System (DNS) Zones is any distinct, connecting segment of domain name space in Domain Name System (DNS) for which administrative responsibility has been delegated to single administrativ
4 min read
Working of Domain Name System (DNS) Server
Prerequisite - Domain Name System (DNS) in Application Layer In the world of networking, computers do not represent by names like humans do, they represent by numbers because that is how computers and other similar devices talk and identify with each other over a network, which is by using numbers such as IP addresses. Humans on the other hand are
7 min read
How the Domain Name System (DNS) Works?
Answer: DNS translates human-readable domain names like www.example.com, into IP addresses like 192.0.2.1, that computers use to identify each other on the network.Query Initiation When you enter a domain name (e.g., www.example.com) in your web browser, it initiates a DNS query to translate the domain into an IP address. Recursive ResolverThe quer
1 min read
Address Resolution in DNS (Domain Name Server)
Prerequisite - Domain Name Server Mapping a domain name to an IP Address is known as Name-Address Resolution. The Domain Name Server (DNS) Resolver performs this operation by consulting name servers. Mapping name to an address or an address to a name is called name-address resolution. RESOLVERDNS is designed as a client -server application.A host t
8 min read
Difference Between Network Layer Protocols and Application Layer Protocols
Prerequisite: Basics of Computer Network In the world of computer networking, protocols are the set of rules that govern communication between devices. These rules dictate how devices should send and receive data over a network. Protocols are typically organized into layers, with each layer serving a specific purpose and working in conjunction with
6 min read
DNS Spoofing or DNS Cache poisoning
Prerequisite - Domain Name Server Before Discussing DNS Spoofing, First, discuss what is DNS.A Domain Name System (DNS) converts a human-readable name (such as www.geeksforgeeks.org) to a numeric IP address. The DNS system responds to one or more IP-address by which your computer connects to a website (such as geeksforgeeks.org) by using one of the
3 min read
How Does DNS Resolve Domain Names To IP Addresses On Internet?
Answer: The DNS (Domain Name Server) resolve domain names to IP addresses on the internet using the ISP cache, DNS root server, top-level domain server, second-level domain server and DNS records and recursive DNS resolver.Steps For DNS Resolve Domain Names to IP Addresses Below are the steps in which DNS resolve domain names to IP addresses. First
2 min read
How Does DNS Resolve Domain Names to IP Addresses?
Answer: DNS resolves domain names to IP addresses by querying hierarchical DNS servers, starting from the local resolver, root servers, TLD servers, authoritative DNS servers, and caching responses. Below are the steps describing how DNS resolves domain names to IP Addresses. Step 1: Domain Name Resolution RequestWhen the user enters any specific d
2 min read
Collision Domain and Broadcast Domain in Computer Network
Prerequisite - Network Devices, Transmission Modes The most common network devices used are routers and switches. But we still hear people talking about hubs, repeaters, and bridges. Do you ever wonder why these former devices are preferred over the latter ones? One reason could be: 'because they are more efficient and powerful'. But what actually
5 min read
DNSSEC (Domain Name System Security Extensions) Implementation
Domain Name System Security Extensions(DNSSEC) is a combination of protocols and cryptographic technology(digital signature) for Domain Name System (DNS) and developed for integrity and security enhancement. Cyberattacks and DNS manipulation are the key concerns for Domain Name System Security Extensions(DNSSEC) as to tackle and prevent phishing, d
9 min read
What is Domain Name System Security Extensions (DNSSEC)?
Domain Name System Security Extensions augment the function of the Domain Name System or the DNS through the introduction of security measures in the form of signatures. This prevents the user from receiving various types of cyber attacks, including cache poisoning and man-in-the-middle attacks while translating the received information. DNSSEC mak
15+ min read
Difference Between Network Address Translation and Domain Name System
Network Address Translation (NAT) and Domain Name System (DNS) are two core technologies in networking that serve different purposes. The NAT facilitates the problem of the shortage of IP addresses by permitting multiplicity of devices within a local network to use a single public IP address, hence enhancing safety and reducing wastage of IP addres
10 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Why Flow Control is Used in Both Data Link Layer and Network Layer?
OSI model was established in1947 by international standard organization is a multinational body dedicated to worldwide agreement on international standards.ISO standard covers all the aspects of network communications is the Open System Interconnection model.It was introduced in the late 1070s. an open system is a set of protocols that allows any t
6 min read
Which Layer Called Error Detection Layer?
Answer: The Data Link layer is often referred to as the error detection layer.And, Transport Layer is also responsible for error detection and recovery in data communication. Error DetectionThe Data Link layer is responsible for transferring data frames between adjacent network nodes. During this process, it employs error detection techniques to en
1 min read
Difference Between Secure Socket Layer (SSL) and Transport Layer Security (TLS)
SSL stands for Secure Socket Layer while TLS stands for Transport Layer Security. Both Secure Socket Layer and Transport Layer Security are the protocols used to provide security between web browsers and web servers. The main difference between Secure Socket Layer and Transport Layer Security is that, in SSL (Secure Socket Layer), the Message diges
4 min read
Difference between layer-2 and layer-3 switches
A switch is a device that sends a data packet to a local network. What is the advantage of a hub? A hub floods the network with the packet and only the destination system receives that packet while others just drop due to which the traffic increases a lot. To solve this problem switch came into the picture. A switch first learns, by flooding the ne
5 min read
Difference Between Trademark and Domain Name
1. Trade Mark : A trade name is a name used to register a business as a legal entity within the state where it operates. Usually, this is often done at the Secretary of State or the Department of Corporations, or an identical state-run agency. A trade name must be unique within the state where it is registered. The trade name is additionally regist
4 min read
Introduction to Domain Name
Every computer on the Internet has an address which is unique in nature. It is a string of numbers and is referred to as IP address. To communicate with each other, computers identify another computer via its IP address. It is represented in either dotted decimal notation or in binary decimal notation. Example: The address 172.16.122.204 when repre
4 min read
How domain name is transferred in IP address?
Answer: Domain Name System (DNS) resolution is the process of mapping a domain name to an IP address. Steps for domain name is transferred in IP address: Registration of Domain Names: First of all, a domain name has to be registered with the domain registrar, and only then an IP can be assigned to it. It helps in keeping records of the IP addresses
2 min read
How To Get an IP Address from Domain Name?
Answer: We can get an IP address from domain name using ping commands and nslookup command.Steps To Get an IP Address from Domain NameStep 1: First, Open a command prompt window. On Windows, search for "cmd" in the Start menu. On macOS or Linux, open a terminal window. Step 2: Using the Ping Command The primary TCP/IP command used to diagnose conne
2 min read
Difference Between Domain Name and URL
In the world of the internet and websites, Domain Name and URL are very common terms and are used interchangeably, but there is a lot of difference between these two terms. In this article, we will learn what the difference is between a domain name and a URL. What is a Domain Name?It is very hard to remember the IP address of the server. Hence, the
6 min read
Application Layer Protocols in TCP/IP
TCP/IP stands for Transport Control Protocol/Internet Protocol. TCP/IP suite is considered as a basis on which a virtual network exists. TCP/IP makes use of client-server model for communication where service is provided by the server to the client or other systems. TCP/IP protocol consists of four layers. TCP/IP defines the rules, standards, and f
7 min read
Protocols in Application Layer
The Application Layer is the topmost layer in the Open System Interconnection (OSI) model. This layer provides several ways for manipulating the data which enables any type of user to access the network with ease. The Application Layer interface directly interacts with the application and provides common web application services. The application la
7 min read
File Transfer Protocol (FTP) in Application Layer
FTP or File Transfer Protocol is said to be one of the earliest and also the most common forms of transferring files on the internet. Located in the application layer of the OSI model, FTP is a basic system that helps in transferring files between a client and a server. It is what makes the FTP unique that the system provides a reliable and efficie
12 min read
Application Layer in OSI Model
The Application Layer of OSI (Open System Interconnection) model, is the top layer in this model and takes care of network communication. The application layer provides the functionality to send and receive data from users. It acts as the interface between the user and the application. The application provides services like file transmission, mail
9 min read
DNS Look-Up
Prerequisite - Domain Name System (DNS) Need of DNS : There are 232 IP Addresses (approximately 4, 294, 967, 296). With growth of internet at a rapid pace came issue of remembering websites with their IP Address (not an issue if superhuman or bot pretending to be human). This issue was resolved using DNS. Domain Name System is method of resolving h
3 min read
How to Change DNS Server Settings Windows, Mac, Ubuntu and Android?
DNS stands for Domain Name System. It is a translation service that converts a domain name to Ip address. DNS server is an implementation of DNS. Whenever you try to visit any URL, then the browser requests the IP address of that URL from the DNS server provided by your ISP, and the DNS Server in response to this request sends the corresponding IP
4 min read
Setting up local DNS server between client-server machines
In this, article you will see the overview of DNS server and how to set up the local DNS server between the client and server machines. And here we will use Wireshark. Let's discuss it one by one. Introduction :A DNS server is computer server that contains a database of public IP addresses and their associated hostname, and in most cases serves to
5 min read
three90RightbarBannerImg