DNS - Basics
DNS – What is it?
Computers understand only ‘numbers’
People tend to remember memory-friendly ‘names’
instead of IP addresses.
Domain Names are alpha numeric names for IP
addresses.
Eg. www.abc.com
DNS (Domain Names System) is an internet-wide
distributed database that translates between domain
names and ip addresses.
Before DNS existed.
There was a file called ‘hosts.txt’
The translation from name-to-ip address was done
by downloading a single file(hosts.txt) from a central
server.
The hosts.txt file still works on most OS, which is
used to define local names
Eg. in linux, navigate to /etc/ and look for ‘hosts’ and
view the contents, see for yourself.
Resolver & Name server
Caching
To reduce DNS traffic, name servers caches
information on domain name/IP address mappings.
When an entry for a query is in the cache, the server
does not contact other servers.
NOTE: if any entry is sent from a cache, the reply
from the server is marked as “unauthoritative”.
DNS name Hierarchy
DNS name Hierarchy
Domain Names
Hosts and DNS domains are named in their positions in the
domain tree.
Every node in the DNS domain tree can be identified by a Fully
Qualified Domain Name (FQDN). The FQDN gives position in
the DNS tree.
Eg. irctc.co.in
A FQDN consists of labels “irctc”.”co”.”in” seperated by a dot(.)
Each label can be up to 63 characters long.
FQDN contains characters, numerical and dash character (-)
FQDNs are not case-sensitive
Top Level Domains (TLDs)
3 types of TLDs.
There are more than 200 TLDs.
Organizational: 3 character Eg. [ .com ; .mil ; .edu ; .gov ;
code indicates function of .net ]
organization
Geographical: 2 character country or Eg. [ .in ; .jp ; .cn ; .tv ; .de ; .va ]
region code
Reverse Domains: A special domain
(in-addr.arpa) used fir IP address-to-
name mapping
DNS domains & Zones
Primary and secondary name servers
For each zone, there must be a primary and
secondary name server.
The primary (master) server maintains a zone file
which has information about zone. Updates are
made to primary server.
The secondary server copies data stored at the
primary server.
When a new host is added to a zone, the admin adds
the IP info on the host (IP addr & name) to
configuration file on primary server.
Resource Records.
Zone file example
Root name servers
Root name servers know how to find the
authoritative name servers for Top level zones.
There are only 13 root name servers. They are critical
for proper functioning of name resolution.
Root Servers.
Root Servers