DOMAIN NAME SYSTEM(DNS)
Mrs G Parimala
Assistant Professor
Department of CSE
Topics
What is DNS
Need of DNS
DNS Components
• The DNS Name Space
• Resource Records
• Name Servers
• DNS resolver
How does DNS works
What is DNS?
• The Domain Name System (DNS) turns domain names
into IP addresses, which browsers use to load internet
pages.
• A client-server application that maps host names into
their corresponding IP addresses.
• Every device connected to the internet has its own IP
address, which is used by other devices to locate the
device.
• Mapping host names into their corresponding IP
addresses is called name resolution or name translation
or name mapping or Address Resolution.
Why we need DNS?
Why we need DNS?
As the system grew, [Link] had problems with:
• Scalability (traffic and load) – No limit to the size of
the database, no limit to the number of queries.
• Reliability – Data is replicated ( data from master is
copied to multiple slaves)
• Dynamicity – Database can be updated dynamically
• Name collisions - avoid the same names
• Consistency
Why we need to use Name instead of IP
Number?
IP addresses are difficult to remember
• IP addresses can change
Problem:
• Network only understands numeric addresses
Solution:
• Use alpha numeric names to refer to hosts
• Add a distributed, hierarchical protocol (called
DNS) to map between alpha numeric host names
and IP addresses.
DNS Name Space
What is a Name space?
• Namespace is the abstract space or collection of all possible
addresses, names, or identifiers of objects on a network,
internetwork, or the Internet. A namespace is “the space of all
names” for a given type of network name.
• The Internet is divided into more than 200 top-level domains.
• Domain: It is sub tree of the domain name space and consists
of group of hosts that are under the administrative control of a
single entity such as a company or a government agency
• Each domain is sub divided into sub domains
• The leaves represent domains that have no sub domains
• A leaf domain may contain a single host, or represent a
company with thousands of hosts
DNS Name Space
DNS Resource Records
DNS resource Record frame format
Domain name:
• This is a variable-length field containing the domain name. It
is a duplication of the domain name in the question record.
Since DNS requires the use of compression everywhere a
name is repeated, this field is a pointer offset to the
corresponding domain name field in the question record.
Domain type:
• This field is the same as the query type field in the question
record except the last two types are not allowed.
Domain class:
• This field is the same as the query class field in the question
record.
Time-to-live:
• This is a 32-bit field that defines the number of seconds the
answer is valid. The receiver can cache the answer for this
period of time. A zero value means that the resource record is
used only in a single transaction and is not cached.
Resource data length:
• This is a 16-bit field defining the length of the resource data.
Resource data:
• This is a variable-length field consisting one of the following:
• a. A number: This is written in octets. For example, an IPv4
address is a 4-octet integer and an IPv6 address is a 16-octet
integer.
• b. A domain name: Domain names are expressed as a sequence
of labels. Each label is preceded by a 1-byte length field that
defines the number of characters in the label. Since every domain
name ends with the null label, the last byte of every domain name
is the length field with the value of 0.
• c. An offset pointer: Domain names can be replaced with an
offset pointer. An offset pointer is a 2-byte field with each of the 2
high-order bits set to 1 (11).
• d. A character string: A character string is represented by a 1-
byte length field followed by the number of characters defined in
the length field.
DNS Name Servers
What is Domain?
• Domain is a sub tree of domain name space
• Root node is empty
• Domain is divided into sub-domains
How does DNS works?
• The process of DNS resolution involves converting a
hostname (such as [Link]) into a
computer-friendly IP address (such as [Link]).
• An IP address is given 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 ([Link]) and the machine-friendly
address necessary to locate the [Link]
webpage.
Root DNS Server
2.
3.
4. Top level Domain(T
Such as .com,.in,.or
Local DNS server
5.
[Link]
1 6
.
7
Authoritative DNS serv
8
[Link]
Requesting host
[Link]
Local DNS server get over loaded [Link]
Root DNS Server
3.
2. 6 Top level
7 Domain(TLD)
server:Such as
.com,.in,.org,.net
Local DNS server
[Link]
4.
1
5.
Authoritative DNS server
[Link]
Requesting host
[Link]
[Link]
Local DNS server load is reduced
What is DNS Name Server?
DNS Server
• A DNS server is a computer with a database
containing the public IP addresses associated with
the names of the websites an IP address brings a
user to.
• DNS acts like a phonebook for the internet.
Whenever people type domain names, like
[Link] or [Link], into the address bar of
web browsers, the DNS finds the right IP address.
• The site’s IP address is what directs the device to
go to the correct place to access the site’s data.
• Once the DNS server finds the correct IP
address, browsers take the address and use it
to send data to content delivery network
(CDN) edge servers or origin servers.
• Once this is done, the information on the
website can be accessed by the user.
• The DNS server starts the process by
finding the corresponding IP address for a
website’s uniform resource locator (URL).
• Name servers store information about the
name space in units called “zones”
– The name servers that load a complete zone are
said to “have authority for” or “be authoritative
for” the zone
• Usually, more than one name server are
authoritative for the same zone
– This ensures redundancy and spreads the load
• Also, a single name server may be
authoritative for many zones
• Name servers store information about
the name space in units called “zones”
– The name servers that load a complete
zone are said to “have authority for” or “be
authoritative for” the zone
• Usually, more than one name server are
authoritative for the same zone
– This ensures redundancy and spreads the
load
• Also, a single name server may be
authoritative for many zones
Name Servers and Zones
[Link] serves
data for both
[Link] and
[Link] zones
[Link]
nominum
[Link]
serves data for
[Link] [Link]
zone only
[Link]
[Link]
serves data for
[Link]
[Link] zone only
Types of Name Servers
• Two main types of servers
– Authoritative – maintains the data
• Master – where the data is edited
• Slave – where data is replicated to
– Caching – stores data obtained from an
authoritative server
– The most common name server implementation
(BIND) combines these two into a single process
Name Server Architecture
Zone
Name Server Process
data
From
file
Authoritative Data disk
(primary master and Master
Zone transfer
slave zones) server
Cache Data
(responses from
other name servers)
Agent
(looks up queries
on behalf of resolvers)
Authoritative Data
Name Server Process
Authoritative Data
(primary master and
slave zones) Response
Cache Data
(responses from
other name servers)
Agent
(looks up queries Resolver
Query
on behalf of resolvers)
Using Other Name Servers
Name Server Process
Authoritative Data
(primary master and
slave zones)
Response
Cache Data
Response
(responses from
Arbitrary
other name servers)
name
Agent Query server
(looks up queries Query
Resolver
on behalf of resolvers)
Copyright © 2001, Nominum, Inc.
DNS Resolver
Name Resolution
• Name resolution is the process by which
resolvers and name servers cooperate
to find data in the name space
• To find information anywhere in the
name space, a name server only needs
the names and IP addresses of the
name servers for the root zone (the
“root name servers”)
– The root name servers know about the top-
level zones and can tell name servers whom
to contact for all TLDs
Copyright © 2001, Nominum, Inc.
Name Resolution
• A DNS query has three parameters:
– A domain name (e.g., [Link]),
• Remember, every node has a domain name!
– A class (e.g., IN), and
– A type (e.g., A)
• A name server receiving a query from a
resolver looks for the answer in its
authoritative data and its cache
– If the answer isn’t in the cache and the server
isn’t authoritative for the answer, the answer
must be looked up
Copyright © 2001, Nominum, Inc.
Figure: Example of a resolver looking up for a remote name