Monday, October 3, 2011

Configure Slave DNS server on solaris 10

Configure Slave DNS server Solaris


Slave DNS server provide DNS services even if the master goes down , Slave DNS server gets its zone data using a zone transfer operation from a zone master (master DNS server) , Zone transfer is the process of  receiving  data from master server to slave server.

Slave DNS server Configuration : -

Configure Master DNS server
   Configure SLave DNS server

Master Server IP address :- 192.168.2.2
Slave Server IP address  :- 192.168.2.3
Master Server Name       :- ns1.test.domain
Slave Server Name        :- ns2.test.domain


Configure Master DNS server

make sure your DNS daemon is disabled.

 svcadm disable dns/server  

create the DNS confiuration file "named.conf"
 touch /etc/named.conf 

 
edit the "named.conf" file
 vi /etc/named.conf 



The file will be opened for editing , if you don't know how to use VI editor follow this link to be more familiar with VI Editor:- UNIX VI editor

add the following lines to the "named.conf" file , Note : Don't add "Block #" word it's just for illustration purpose.

Block 1
options {  
         "/var/named";  
 }; 

Block 2
zone "." {  
       type hint;  
       file "db.cache";  
 };

Block3
zone "0.0.127.in-addr.arpa" {  
            type master;  
            file "db.127.0.0";  
 }


Block4
zone "2.168.192.in-addr.arpa" {  
               type master;  
               file "db.192.168.2";  
 };


Block5
zone "domain.test" {  
             type master;  
             file "db.domain.test";  
 };



Note That :-
Block1:-tells the DNS that zone files are located in "/var/named".
Block2:- tells the DNS the address of root servers and the zone configuration file is called db.cache , if you don't know what root servers follow this link HOW DNS WORK.
Block3:-tells the DNS server there are  a localhost zone and its called db.127.0.0 This zone allows resolution of the name 'localhost' to the loopback address 127.0.0.1 when using the DNS server.
Block4:- tells the DNS server that there are reverse lookup zone and the zone configuration file is called db.192.168.2 .
Block5:- tells the DNS server that there are forward zone and the zone configuration file is called db.domain.test.

Now create zone files on master server 

as shown in "named.conf" file there are four zone configuration files.
db.cache , db.127.0.0 , db.192.168.2 , domain.test .

create db.cache
 mkdir /var/named 
 cd /var/named 

Download root servers file
 /usr/sfw/bin/wget ftp://ftp.rs.internic.net/domain/named.root 


rename named.root to db.cache
 mv named.root db.cache 


create db.127.0.0
 vi db.127.0.0 



type the following information inside "db.127.0.0" file
@ IN SOA server_name.domain.test. admin_mail.domain.test. (  
      20110622 ; serial number   
      7200 ; Refresh Interval  
      3600 ; Retry Interval  
      86400 ; Expire  
      600 ) ; TTL  
      NS ns1.
      NS ns2. 
 1     IN     PTR     localhost. 


Note :-
ns1. is:-(your DNS server name), to find your server name :-
 uname -n 

The serial number is a record of how often this DNS entry has been updated. Every time a change is made to the entry, the serial number must be incremented.

✔ The "refresh" number stands for how often secondary name servers should check the primary for a change in the serial number.

✔ Expire" is how long the secondary server should use its current entry if it is unable to perform a refresh

✔ "minimum" is how long other nameservers should cache, or save, this entry

create db.192.168.2
 vi db.192.168.2 

type the following information inside "db.192.168.2" file .

@ IN SOA ns1.domain.test. admin_mail.domain.test. (  
      20110622 ; serial number   
      7200 ; Refresh Interval  
      3600 ; Retry Interval  
      86400 ; Expire  
      600 ) ; TTL  
      NS ns1. 
     NS ns2.
2     IN     PTR     localhost.



Note :
2     IN     PTR     localhost.  => 2 is the last part of the server ip (192.168.2.2)

create db.domain.test 
 vi db.domain.test


type the following information inside "db.domain.test" file .

@ IN SOA server_name.domain.test. admin_mail.domain.test. (  
      20110622 ; serial number   
      7200 ; Refresh Interval  
      3600 ; Retry Interval  
      86400 ; Expire  
      600 ) ; TTL  
      NS ns1.
      NS ns2.  
ns1    IN     A     192.168.2.2 
ns2    IN     A     192.168.2.3


check your configuration syntax
named-checkconf -z /etc/named

if there are any errors you will see a warning messages.

- enable dns server daemon
 svcadm enable dns/server


- check the status of dns/server daemon
 svcs -a | grep dns/server
online         19:42:04 svc:/network/dns/server:default 

   Configure SLave DNS server 

 login to your  Slave DNS server 
make sure your DNS daemon is disabled.
 svcadm disable dns/server  


create the DNS confiuration file "named.conf"
 touch /etc/named.conf 


edit the "named.conf" file
 vi /etc/named.conf 


The file will be opened for editing , if you don't know how to use VI editor follow this link to be more familiar with VI Editor.

add the following lines to the "named.conf" file.

options     {  
      directory "/var/named";  
 };  
 zone "." {  
      type hint ;  
      file "db.cache";  
 };  
 zone     "0.0.127.in-addr.arpa" {  
      type slave ;  
      file "db.127.0.0";  
      masters {192.168.2.2;};  
 };  
 zone     "9.109.10.in-addr.arpa" {  
      type slave ;  
      file "db.10.109.9" ;  
      masters {192.168.2.2;};  
 };  
 zone     "2.168.192.in-addr.arpa" {  
      type slave ;  
      file "db.192.168.2" ;  
      masters {192.168.2.2;};  
 };  
 zone     "test.internal" {  
      type slave ;  
      file "db.test.internal" ;  
      masters {192.168.2.2;};  
 } ;  

Now create zone files :- db.127.0.0 , db.cache
create db.cache
 mkdir /var/named 
 cd /var/named 

Download root servers file
 /usr/sfw/bin/wget ftp://ftp.rs.internic.net/domain/named.root 


rename named.root to db.cache
 mv named.root db.cache 



create db.127.0.0
 vi db.127.0.0 



type the following information inside "db.127.0.0" file
@ IN SOA server_name.domain.test. admin_mail.domain.test. (  
      20110622 ; serial number   
      7200 ; Refresh Interval  
      3600 ; Retry Interval  
      86400 ; Expire  
      600 ) ; TTL  
      NS ns1.
      NS ns2. 
 1     IN     PTR     localhost. 

check your configuration syntax
named-checkconf -z /etc/named


 if there are any errors you will see a warning messages.

  enable dns server daemon
 svcadm enable dns/server


check the status of dns/server daemon
 svcs -a | grep dns/server
online         19:42:04 svc:/network/dns/server:default 

0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes