Setting DNS Server with Bind


Tambahkan baris – baris berikut pada bagian bawah file konfigurasi pada /etc/named.conf.

zone "bani.com" {
type master;
notify no;
allow-query { any; };
file "bani.zone";
};

zone "smiert.org" {
type master;
notify no;
allow-query { any; };
file "smiert.zone";
};

zone "0.168.192.in-addr.arpa" {
type master;
notify no;
file "192-168-0.zone";
};

Buat file bani.zone
# vi /var/named/chroot/var/named/bani.zone

$TTL 3D
@ IN SOA ns1.bani.com. hostmaster.bani.com. (
200211152 ; serial#
3600 ; refresh, seconds
3600 ; retry, seconds
3600 ; expire, seconds
3600 ) ; minimum, seconds

NS www ; Inet Address of nameserver
bani.com. MX 10 mail ; Primary Mail Exchanger

localhost A 127.0.0.1
server A 192.168.0.1
mail A 192.168.0.2
ns1 CNAME server
www CNAME server

Buat file smiert.zone
# vi /var/named/chroot/var/named/smiert.zone

$TTL 3D
@ IN SOA ns1.smiert.org. hostmaster.smiert.org. (
200211152 ; serial#
3600 ; refresh, seconds
3600 ; retry, seconds
3600 ; expire, seconds
3600 ) ; minimum, seconds

NS www ; Inet Address of nameserver
smiert.org. MX 10 mail ; Primary Mail Exchanger

localhost A 127.0.0.1
server A 192.168.0.1
mail A 192.168.0.3
ns1 CNAME server
www CNAME server

Buat file 192-168-0.zone
# vi /var/named/chroot/var/named/192-168-0.zone

$TTL 3D
@ IN SOA www.bani.com. hostmaster.bani.com. (
200303301 ; serial number
8H ; refresh, seconds
2H ; retry, seconds
4W ; expire, seconds
1D ) ; minimum, seconds

NS www ; Nameserver Address

$TTL 3D
@ IN SOA www.smiert.org. hostmaster.smiert.org. (
200303301 ; serial number
8H ; refresh, seconds
2H ; retry, seconds
4W ; expire, seconds
1D ) ; minimum, seconds

NS www ; Nameserver Address


Agar service named berjalan otomatis pada saat booting
# chkconfig named on

Cara mengontrol service named dengan
# /etc/init.d/named { start | stop | status | restart | condrestart | configtest }

Mengecek apakah service berjalan dengan baik
# dig www.bani.com

atau
# nslookup www.smiert.org

Popular posts from this blog

Howto configure boot device order on ILOM

Installing Depot files on HP-UX 11.23 ia64

SAN Switch Config Command