Konfigurasi DNS di Linux Fedora 7
Berikut langkah-langkah membuat DNS server :
1. Setting IP di Fedora
Pilih eth sesuai lancard.
# vi /etc/sysconfig/network-script/ifcfg-eth0
Isi seperti di bawah ini:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.21.255
HWADDR=00:0c:29:d3:65:4b
IPADDR=192.168.21.1 (Ip anda)
NETMASK=255.255.255.0
NETWORK=192.168.21.0 (Ip network anda)
ONBOOT=yes
DNS1=192.168.21.1 (DNS anda)
NM_CONTROLLED=
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.21.255
HWADDR=00:0c:29:d3:65:4b
IPADDR=192.168.21.1 (Ip anda)
NETMASK=255.255.255.0
NETWORK=192.168.21.0 (Ip network anda)
ONBOOT=yes
DNS1=192.168.21.1 (DNS anda)
NM_CONTROLLED=
Restart network
# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
2. Install paket yaitu bind dengan perintah
# yum -y install bind
3. Buat direktori named.conf dan konfigurasi :# vi /var/named/chroot/etc/named.conf
atau
# vim /var/named/chroot/etc/named.conf
Setting seperti dibawah :
Tekan tombol Insert.
options {
directory "/var/named/";
};
zone "zainul.com" IN { (Nama Domain anda)
type master;
file "forward"; (Nama file penyimpanan zona foraward anda silahkan anda ganti dengan nama terserah anda)
};
zone "21.168.192.in-addr.arpa" IN { (IP DNS anda)
type master;
file "reverse"; (Nama file penyimpan zona reverse anda silahkan anda ganti dengan nama terserah anda)
};
Kemudian Simpan dengan tekan ESC ketik :wq Enter
4. Buat file zone forward dan reverse dengan nama sama dengan yang di set di named.conf.
Jika Bind di install pada saat menginstall fedora 7 :
# cd /var/named/chroot/var/named/ (Masuk ke direktori named)
# cp localhost.zone forward (Kemudian copy localhost.zone dengan nama zona forward anda)
# cp named.local reverse (Copy named.local dengan nama zona reverse anda)
Bind di install selesai menginstall fedora 7 :
# cd /usr/share/doc/bind-9.4.0/sample/var/named/
# cp localhost.zone /var/named/chroot/var/named/forward (forward nama file direktori sama dingan di named.conf)
# cp named.local /var/named/chroot/var/named/reverse (reverse nama file direktori sama dingan di named.conf)
5. Setting zona forward dan reverse
# cd /var/named/chroot/var/named/
Setting zone forward
# vi forward
$TTL 86400
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS zainul.com. (nama domain anda.)
ns IN A 192.168.21.1 (Ip DNS anda)
@ IN A 192.168.21.1 (Ip DNS anda)
www IN A 192.168.21.1 Subdomain www (Ip DNS anda)
IN AAAA ::1
Setting zone reverse
# vi reverse
$TTL 86400
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS zainul.com. (nama domain anda.)
1 (IP DNS anda) IN PTR zainul.com. (nama domain anda.)
6. Jangan Lupa di chmod zone forward dan reverse # chmod 777 /var/named/chroot/var/named/forward -R
# chmod 777 /var/named/chroot/var/named/reverse -R
7. Setting resolv
# vi /etc/resolv.conf
Tambahkan :
nameserver 192.168.21.1 (IP DNS anda)
8. Restart Named# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
9. Cek dengan perintah : # nslookup
> zainul.com
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: zainul.com
Address: 192.168.21.1
> www.zainul.com
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: www.zainul.com
Address: 192.168.21.1
> exit
Nice of artikel....