Install bind and related packages.
#
apt-get install bind9 dnsutils
Enter
in installed directory
cd
/etc/bind/
Open
name.conf and add rndc key
#
vi name.conf
key
"rndc-key" {
algorithm hmac-md5;
secret
"XNBYnQX/sv+KJj3JgwPWPA==";
};
key
"EMERGEN" {
algorithm hmac-md5;
secret
"7ESb2eNqmOs9QTc8WnggPg==";
};
Open
vi name.conf.local and add these lines
#
vi name.conf.local
zone
"emergen.org" in {
file
"/etc/bind/master/emergen.org";
type master;
allow-transfer { key EMERGEN; };
};
zone
"1.168.192.in-addr.arpa" {
type master;
file
"/etc/bind/master/reverse-1.168.192.in-addr.arpa";
allow-transfer { key EMERGEN; };
};
Create
directory for forward and reverse file.
#
mkdir master
#
cd master
Create
a forward zone file
#
vi emergen.org
$TTL
2d
@ IN SOA ns1.emergen.org. hostmaster.emergen.org.
(
8 ; serial
3h
; refresh
1h ; retry
1w ; expiry
1d ) ; minimum
emergen.org. IN NS ns1.emergen.org.
IN MX 10 mail.emergen.org.
IN A 192.168.1.92
www IN
A 192.168.1.92
mail IN
A 192.168.1.92
Create
Reverse zone file
#
vi reverse-1.168.192.in-addr.arpa
$TTL
86400;
@
IN SOA ns1.emergen.org. hostmaster.emergen.org. (
23 ; serial
10800 ; Refresh after 3 hours
3600 ; Retry after 1 hour
604800 ; Expire after 1 week
86400 ) ; Minimum TTL of 1 day
;
;
Name Servers
;
IN NS ns1.emergen.org.
IN NS ns2.emergen.org.
Restart
bind
#
/etc/init.d/bind9 restart
Test
bind with the help of nslookup command.
#
nslookup emergen.org
Server: 192.168.1.92
Address: 192.168.1.92#53
Name: emergen.org
Address:
192.168.1.92
If you'll gate this output that
means Naming service is working fine.
No comments:
Post a Comment