Tuesday, November 22, 2011

DNS ( Domain Name Server)

DNS:-

DNS translate IP address to hostname or vise versa

Service Profile

Type                         :    System V manage
Package                   :    bind, bind-chroot, caching-nameserver, bind-utils
Daemon                  :    named
Script                       :    named
Configuration file   :
                                      /var/named/chroot/etc/named.conf
                                     /var/named/chroot/var/named/*
Port                           :    52 (UDP), 53 (TCP)

Server Setting :-

  1. Edit the file named.conf
#vi /var/named/chroot/etc/named.conf
Edit the line after copying line N 37 to line 47
Zone “example.com”{
            Type master;
            File “example.zone”;
            Allow-update {none;}            ;
};
Zone “24.172.in-addr.arpa”IN{
            Type master;
            File “example.local”;
            Allow-update {none;};
};

  1. Now Enter inside the following directory
#cd /var/named/chroot/var/named
Make two file by copying
#cp localhost.zone example.zone
#cp named.local example.local

  1. Edit the file example.zone
$TTL 86400
@         IN        SOA    server1.example.com.  root.server1.example.com. (
                                                                                    ……….
                                                                                    ……….
                                                                                    ……….
                                                                                    ……)
@         IN        NS       server1.example.com.
254.254           IN        PTR     server1.example.com.
1.0                   IN        PTR     station1.example.com.
2.0                   IN        PTR     station2.example.com.
4.0                   IN        PTR     station3.example.com.
Note:
Like this we can make entry all the stations connected to that network

Save and exit

  1. Edit example.local file
#vi example.local
$TTL 86400
@         IN        SOA    server1.example.com.  root.server1.exampler.com  (
                                                                                    …………
                                                                                    …………
                                                                                    …………
                                                                                    ….)
@         IN        NS       server1.example.com.
Server1           IN        A         172.24.254.254
Station1          IN        A         172.24.0.1
Station2          IN        A         172.24.0.2
Station3          IN        A         172.24.0.3
Station4          IN        A         172.24.0.4
www              IN        CNAME         server1
www1                        IN        CNAME         station1
www2                        IN        CNAME         station2
www3                        IN        CNAME         station3
www4                        IN        CNAME         station4

save and exit

  1. Start the service
#service named restart
#chkconfig named on

  1. Dig the server
#dig server1.example.com
#nslookup server1.example.com
#nslookup 172.24.254.254

  1. Check the file /etc/hosts file 

DNS Client :-


Open the file and check the setting
#vi /etc/resolv.conf
Nameserver    172.24.254.254
Search             example.com

Savce and exit

Now finally use the Dig and nslookup command to check the DNS from client side

Term
IN        :           Internet
SOA    :           Start Of Authority
TTL     :           Time to Line
NS       :           Name server
A         :           Address Record
PTR     :           Pointer Record
MX      :           Mail server
SOA is the first line in the zone file. It identifies the name server as the authoritative source for information about this domain
TTL indicate how long to hold the data in their cache
NS shows the name of name server
A shows the IP address for name server
MX is a mail Exchange record
PTR is used to point to the name server
CNAME is CONONICAL name shows the real name of the host


Thanks ,

No comments:

Post a Comment