Saturday, September 24, 2011

Configure DNS server on oracle solaris 10

Master DNS Server Configuration 

Estimated Time :- 30 Minutes ツ

To configure DNS server , you need to set up a number of configuration files, mainly you need to configure "named.conf" file and zone files.
named.conf file is located in /etc/, and it includes information about zones and other options.

First Step is to configure "named.conf" file:-

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";  
 }; 
Block2
 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.

second step is to create and configure zone file .
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 server_name.  
 1     IN     PTR     localhost. 


Note :-
server_name.domain.test is:-(your DNS server name).(your domain).
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 server_name.domain.test. admin_mail.domain.test. (  
      20110622 ; serial number   
      7200 ; Refresh Interval  
      3600 ; Retry Interval  
      86400 ; Expire  
      600 ) ; TTL  
      NS server_name.  
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 server_name.  
server_name    IN     A     192.168.2.2 


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

1 comments:

Jubilee said...
This comment has been removed by the author.

Post a Comment

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