BIND Master Slave @ Opensuse 11.1 x86_64

BIND Version version: 9.7.0

ns1 IP Address : 208.99.198.183
ns2 IP Address : 208.99.198.179

- Instalation

# wget ftp://ftp.nominum.com/pub/isc/bind9/9.7.0/bind-9.7.0.tar.gz
# tar -zxvf bind-9.7.0.tar.gz
# make && make install

- Configure ns1 primary name server

Login with root access

# rndc-confgen -a -k rndc-key -b 256
# cat /etc/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "77yB4b3HtL7iz4r4n1R5xmaUlDx5sCNOcxEv6TvgQTo=";
};
# nano /etc/named.conf
key "rndc-key" {
algorithm hmac-md5;
secret "77yB4b3HtL7iz4r4n1R5xmaUlDx5sCNOcxEv6TvgQTo=";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
options {
directory "/var/lib/named";
allow-transfer { 208.99.198.179; };
notify no;
};

zone "ervan.com" in {
type master;
file "ervan.com";
};

zone "198.99.208.in-addr.arpa" in {
type master;
file "198.99.208";
};
# nano /var/lib/named/ervan.com
$TTL 1W
@               IN SOA  @   root (
42              ; serial (d. adams)
2D              ; refresh
4H              ; retry
6W              ; expiry
1W )            ; minimum

ervan.com.      IN NS           ns1.ervan.com.
ervan.com.      IN NS           ns2.ervan.com.
IN MX           10 mail.ervan.com.
IN A            208.99.198.183
ns1             IN A            208.99.198.183
ns2             IN A            208.99.198.179
www             IN A            208.99.198.183
ftp             IN A            208.99.198.183
mail            IN A            208.99.198.183
# nano /var/lib/named/198.99.208
@               IN SOA          localhost.   root.localhost. (
42              ; serial (d. adams)
2D              ; refresh
4H              ; retry
6W              ; expiry
1W )            ; minimum

IN NS           ns1.ervan.com.
IN NS           ns2.ervan.com.
183           IN PTR          ns1.ervan.com.
179           IN PTR          ns2.ervan.com.

# service named start

- Configure ns2 as secondary name server

Login with root access

# nano /etc/named.conf
key "rndc-key" {
algorithm hmac-md5;
secret "77yB4b3HtL7iz4r4n1R5xmaUlDx5sCNOcxEv6TvgQTo=";
};
options {
directory "/var/lib/named";
allow-query { 208.99.198.183;127.0.0.1; };
allow-transfer { 208.99.198.183; };
transfer-format many-answers;
notify no;
};

zone "ervan.com" in {
type slave;
file "ervan.com";
masters { 208.99.198.183; };
};

zone "198.99.208.in-addr.arpa" in {
type slave;
file "198.99.208";
masters { 208.99.198.183; };
};

# chmod 777 /var/lib/named/
# service named start

- Test Result
Bind master slave is success if 2 files (198.99.208 & ervan.com) are appears in /var/lib/named at ns2(slave).
That 2 files (*on ns2) is auto transfered and updated from ns1 if named restarted or refreshed.
you can see log file in /var/log/message at ns2
this is my log file in my ns2 :

Mar  3 07:43:04 chai named[28605]: zone 198.99.208.in-addr.arpa/IN: Transfer started.
Mar  3 07:43:04 chai named[28605]: transfer of '198.99.208.in-addr.arpa/IN' from 208.99.198.183#53: connected using 208.99.198.179#43600
Mar  3 07:43:04 chai named[28605]: zone 198.99.208.in-addr.arpa/IN: transferred serial 42
Mar  3 07:43:04 chai named[28605]: transfer of '198.99.208.in-addr.arpa/IN' from 208.99.198.183#53: Transfer completed: 1 messages, 6 records, 208 bytes, 0.002 secs (104000 bytes/sec)
Mar  3 07:43:05 chai named[28605]: zone ervan.com/IN: Transfer started.
Mar  3 07:43:05 chai named[28605]: transfer of 'ervan.com/IN' from 208.99.198.183#53: connected using 208.99.198.179#35713
Mar  3 07:43:05 chai named[28605]: zone ervan.com/IN: transferred serial 42
Mar  3 07:43:05 chai named[28605]: transfer of 'ervan.com/IN' from 208.99.198.183#53: Transfer completed: 1 messages, 11 records, 265 bytes, 0.001 secs (265000 bytes/sec)
ervan:~ # dig www.ervan.com

; <<>> DiG 9.7.0 <<>> www.ervan.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33334
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.ervan.com.                 IN      A

;; ANSWER SECTION:
www.ervan.com.          604800  IN      A       208.99.198.183

;; AUTHORITY SECTION:
ervan.com.              604800  IN      NS      ns1.ervan.com.
ervan.com.              604800  IN      NS      ns2.ervan.com.

;; ADDITIONAL SECTION:
ns1.ervan.com.          604800  IN      A       208.99.198.183
ns2.ervan.com.          604800  IN      A       208.99.198.179

;; Query time: 0 msec
;; SERVER: 208.99.198.183#53(208.99.198.183)
;; WHEN: Wed Mar  3 09:34:18 2010
;; MSG SIZE  rcvd: 115

Category: Linux | Tags: , , , , , , , Comment »


Leave a Reply



Back to top