Friday, 3 January 2014

SAMPLE DNS SERVER CONFIGURATION IN SOLARIS 10

-bash-4.1# cat /etc/named.conf
options {
         directory "/var/named";
};

zone "sai.com" {
         type master;
         file "for.sai.com";
};
zone "10.66.10.in-addr.arpa" {
         type master;
         file "rev.sai.com";
};
-bash-4.1# cat /var/named/for.sai.com
@ IN SOA testserver.sai.com root.testserver.sai.com (
                 1997071401       ;  serial number (YYYYMMDD##)
                      10800       ;  refresh every 3 hours
                      10800       ;  retry every 3 hours
                      604800      ;  expire after a week
                      86400 );     ;  TTL of 1 day
  IN      A      10.66.10.101
  IN      NS     root.testserver.sai.com
testserver          IN          A       10.66.10.101
sai.com             IN          A       10.66.10.101
-bash-4.1# cat /var/named/rev.sai.com
@ IN SOA testserver.sai.com root.testserver.sai.com (
                 1997071401       ;  serial number (YYYYMMDD##)
                      10800       ;  refresh every 3 hours
                      10800       ;  retry every 3 hours
                      604800      ;  expire after a week
                      86400 );     ;  TTL of 1 day
  IN      NS     root.sai.com
  IN      A      10.66.10.101
101       IN         PTR   testserver
-bash-4.1# cat /etc/resolv.conf
DomainName sai.com
NameServer 10.66.10.101
-bash-4.1# cat /etc/defaultdomain
sai.com
-bash-4.1# dig sai.com

; <<>> DiG 9.6-ESV-R4-P3 <<>> sai.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49633
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;sai.com.                       IN      A

;; ANSWER SECTION:
sai.com.                86400   IN      A       10.66.10.101

;; AUTHORITY SECTION:
sai.com.                86400   IN      NS      root.testserver.sai.com.sai.com.

;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Dec 15 15:23:42 2012
;; MSG SIZE  rcvd: 79

-bash-4.1# nslookup
> server
Default server: 127.0.0.1
Address: 127.0.0.1#53
Default server: ::1
Address: ::1#53
> 10.66.10.101
Server:         127.0.0.1
Address:        127.0.0.1#53

101.10.66.10.in-addr.arpa       name = testserver.10.66.10.in-addr.arpa.
> sai.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   sai.com
Address: 10.66.10.101
=======
-bash-4.1# svcadm disable dns/server
-bash-4.1# svcs dns/server
STATE          STIME    FMRI
disabled       15:24:28 svc:/network/dns/server:default
-bash-4.1# svcadm enable dns/server
-bash-4.1# svcs dns/server
STATE          STIME    FMRI
online         15:24:38 svc:/network/dns/server:default
-bash-4.1#

No comments:

Post a Comment