0% found this document useful (0 votes)
2 views6 pages

Assignment-11 - Group C

The document outlines an assignment for a DNS lookup program that translates IP addresses to URLs and vice versa. It explains the Domain Name System (DNS), its structure, hierarchy, and the types of name servers involved in DNS operations. Additionally, it covers the process of DNS lookup, including forward and reverse lookups, and emphasizes the importance of DNS in internet functionality.

Uploaded by

ilvasloma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Assignment-11 - Group C

The document outlines an assignment for a DNS lookup program that translates IP addresses to URLs and vice versa. It explains the Domain Name System (DNS), its structure, hierarchy, and the types of name servers involved in DNS operations. Additionally, it covers the process of DNS lookup, including forward and reverse lookups, and emphasizes the importance of DNS in internet functionality.

Uploaded by

ilvasloma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CNS Lab Manual

Assignment No-11 (Group C)

Problem Definition:
Write a program for DNS lookup. Given an IP address input, it should return URL and vice
versa.
1.1 Prerequisite:
1. IP Address and OSI & TCP/IP Model.
2. Role of different servers.
3. Working of internet.
1.2 Learning Objectives:
1. Understand what is Domain Name System and DNS lookup working.
2. Understand what is DNS Structure and Hierarchy.
1.3 New Concepts:
1. Name Server and Domain Name System.
2. DNS lookup, Zone
1.4 Theory
1.4.1 Introduction
The Domain Name System (DNS) is a hierarchical decentralized naming system for
computers, services, or other resources connected to the Internet or a private network. It
associates various information with domain names assigned to each of the participating
entities.
it translates more readily memorized domain names to the numerical IP addresses needed
for locating and identifying computer services and devices with the underlying network
protocols. By providing a worldwide, distributed directory service, the Domain Name
System is an essential component of the functionality on the Internet that has been in use
since 1985.
[Link] files:
The ARPANET, the predecessor of the Internet, had no distributed host name database.
Each network node maintained its own map of the network nodes as needed and assigned
those names that were memorable to the users of the system.
The hosts file contains lines of text consisting of an IP address in the first text field
followed by one or more host names. Each field is separated by white space – tabs are
often preferred for historical reasons, but spaces are also used. Comment lines may be
included; they are indicated by an octothorpe (#) in the first position of such lines.
Entirely blank lines in the file are ignored. For example, a typical hosts file may contain
the following::1 localhost
1.4.2 Domain Name Space

Dhole-Patil Collage of Engineering, Kharadi, Pune


CNS Lab Manual

The domain name space refers a hierarchy in the internet naming structure. This hierarchy
has multiple levels (from 0 to 127), with a root at the top. The following diagram shows
the domain name space hierarchy:
1.4.3 Name Server
Name server contains the DNS database. This database comprises of various names and
their corresponding IP addresses. Since it is not possible for a single server to maintain
entire DNS database, therefore, the information is distributed among many DNS servers.
∙ Hierarchy of server is same as hierarchy of names.
∙ The entire name space is divided into the zones
1.4.4 Zones
Zone is collection of nodes (sub domains) under the main domain. The server maintains a
database called zone file for every zone.

If the domain is not further divided into sub domains then domain and zone refers to the
same thing.
The information about the nodes in the sub domain is stored in the servers at the lower
levels however; the original server keeps reference to these lower levels of servers.
1.4.5 Types of Name Servers
Following are the three categories of Name Servers that manages the entire Domain
Name System:
1. Root Server
2. Primary Server

Dhole-Patil Collage of Engineering, Kharadi, Pune

2
CNS Lab Manual

2 SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad


Computer Network laboratory (2015) Pattern TE Computer 1 TE Computer

3. Secondary Server

[Link] Root Server


Root Server is the top level server which consists of the entire DNS tree. It does not
contain the information about domains but delegates the authority to the other server
[Link] Primary Servers
Primary Server stores a file about its zone. It has authority to create, maintain, and update
the zone file.
[Link] Secondary Server
Secondary Server transfers complete information about a zone from another server which
may be primary or secondary server. The secondary server does not have authority to create
or update a zone file.
2.1 How does DNS work?
DNS servers answer questions from both inside and outside their own domains. When a
server receives a request from outside the domain for information about a name or address
inside the domain, it provides the authoritative answer. When a server receives a request
from inside its own domain for information about a name or address outside that domain,
it passes the request out to another server -- usually one managed by its internet service
provider. If that server does not know the answer or the authoritative source for the answer,
it will reach out to the DNS servers for the top-level domain -- e.g., for all of .com or .edu.
Then, it will pass the request down to the authoritative server for the specific domain --
e.g., [Link] or [Link]; the answer flows back along the same path.
2.2 How DNS Lookup Works
By now, you know that there are different servers hosting databases that contain the IP
addresses of different domains and their sub-domains. You also know that there are Root

Dhole-Patil Collage of Engineering, Kharadi, Pune

3
CNS Lab Manual

Servers that hold the IP address of servers hosting Top Level Domains. These Root Servers
help in reaching the servers containing databases that hold IP address of the main domain
name. If there are sub-domains, their address can be on the same servers as of the main
domain name or on a different server. All these servers are accessible for finding out the
IP address of the exact URL that you need to use.
∙ Forward Lookup: When a name query is send to the DNS server against to IP
address, it is generally said a forward lookup.

3 SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad


Computer Network laboratory (2015) Pattern TE Computer 1 TE Computer

∙ Reverse Lookup: DNS also provides a reverse lookup process, enabling clients to
use a known IP address during a name query and look up a computer name based
on its address.
The process of finding out the IP address of any URL on the Internet is known as
DNS lookup.
To find out how DNS Lookup works, take the following example.
Example: Consider a network of ten computers. Each computer has its own address so
that data packets travelling in the network know where to go. There is a 11th computer
that hosts a database containing the alias names of each of these ten computers and their
IP addresses. While the computer users can refer to the computers using their names, the
data packets need the IP addresses of the computers so that they can reach the intended
recipient. If computer A needs to use the printer attached to computer B, A will check the
database on 11th computer to know the IP address of B and then find out the address of
printer attached to B. Only after obtaining the address of the printer, A will route the print
command to printer attached to B.
In this case, the following iterations happen:
A contacts Computer 11
A contacts B
A contacts printer attached to B
A similar method is used to lookup DNS records. For example, when you click on
[Link] your router will contact your default DNS Service for DNS resolution. The
DNS service will contact Root Servers and ask for the IP address of server containing .org
records. This address is sent back to your DNS service. The DNS service again reaches the
Name Server containing addresses of .org domains and asks it for the address of
[Link] Upon obtaining the IP address of the servers that host [Link], your DNS

Dhole-Patil Collage of Engineering, Kharadi, Pune

4
CNS Lab Manual

service will return the IP address to your computer which then fires up your browser to
download the main webpage. This means your DNS service is sending at least two requests
to receive the IP address of a simple domain name.
Following is an image that explains how DNS lookup works:

4
SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad
Computer Network laboratory (2015) Pattern TE Computer 1 TE Computer

In the above case, if you were to look for http://


[Link] , your DNS service had to run a request
extra to know its IP address.
Since resolving DNS from scratch every time takes up time, many ISPs and DNS Service
Providers create local caches that contain already resolved addresses. These are primarily
the addresses they already fetched from Root Servers and other Name Servers at some
point of time. In this case, when you send a request for a URL, instead of contacting the
Root server directly, the DNS service would look up for the resolved address of the URL
in its local DNS cache. If found, it would send the resolution back to your computer
instantly else would go ahead and resolve the DNS using the above method of contacting
Root Servers and other Name Servers.
Some operating systems too contain a local cached copy of addresses that you commonly
use on your computer. This too, helps in saving time while using the Internet. We will talk
about DNS caches in a different article at some later point of time.

Dhole-Patil Collage of Engineering, Kharadi, Pune

5
CNS Lab Manual

Assignment Question:
1. Explain the need of DNS system in internet word.
2. What is the website’s IP address ?
3. What are a Forward and Reverse Lookup?
4. What is primary, Secondary, stub & AD Integrated Zone?
5. Explain the DNS hierarchy.
6. What is the [Link]?

Conclusion:
Hence we conclude that we have lookup the URL which we want to visit the request is travels to
local router to DNS server and it resolve the query as possible otherwise it forwards the query to
next DNS hop.

Dhole-Patil Collage of Engineering, Kharadi, Pune

You might also like