Membuat dan konfigurasi DNS server di Linux Fedora 9
Berikut langkah-langkah membuat DNS server :
1. Setting IP di Fedora
# 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. Masuk konfigurasi named
# vi /etc/named.conf
atau
# vim /etc/named.conf (agar terlihat salah atau tidaknya saat di kerjakan)
Setting seperti dibawah ini :
Tekan tombol Insert.
options {
listen-on port 53 { 192.168.21.16/24; }; (ip dns anda misal 192.168.21.1/24 ganti angka 1 dengan 16 di tulis 192.168.21.16/24)
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { 192.168.21.16/24; localhost; }; (tambahkan ip dns anda .16/netmask)
recursion yes;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
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)
};
#include "/etc/named.rfc1912.zones"; (beri tanda #)
Kemudian Simpan dengan tekan ESC ketik :wq Enter
# vi /etc/named.conf
atau
# vim /etc/named.conf (agar terlihat salah atau tidaknya saat di kerjakan)
Setting seperti dibawah ini :
Tekan tombol Insert.
options {
listen-on port 53 { 192.168.21.16/24; }; (ip dns anda misal 192.168.21.1/24 ganti angka 1 dengan 16 di tulis 192.168.21.16/24)
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { 192.168.21.16/24; localhost; }; (tambahkan ip dns anda .16/netmask)
recursion yes;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
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)
};
#include "/etc/named.rfc1912.zones"; (beri tanda #)
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.
# cd /var/named/chroot/var/named/ (Masuk ke direktori named)
# cp named.localhost forward (Kemudian copy named.localhost dengan nama zona forward anda)
# cp named.loopback reverse (Copu named.loopback dengan nama zona reverse anda)
5. Setting zona forward dan reverse
Vi Forward
$TTL 1D
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS zainul.com. (nama domain anda.)
ns A 192.168.21.1 (Ip DNS anda)
@ A 192.168.21.1 (Ip DNS anda)
www A 192.168.21.1 Subdomain www (Ip DNS anda)
AAAA ::1
Vi reverse
$TTL 1D
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS zainul.com. (nama domain anda.)
1 (IP DNS anda) PTR zainul.com. (nama domain anda.)
# cd /var/named/chroot/var/named/ (Masuk ke direktori named)
# cp named.localhost forward (Kemudian copy named.localhost dengan nama zona forward anda)
# cp named.loopback reverse (Copu named.loopback dengan nama zona reverse anda)
5. Setting zona forward dan reverse
Vi Forward
$TTL 1D
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS zainul.com. (nama domain anda.)
ns A 192.168.21.1 (Ip DNS anda)
@ A 192.168.21.1 (Ip DNS anda)
www A 192.168.21.1 Subdomain www (Ip DNS anda)
AAAA ::1
Vi reverse
$TTL 1D
@ IN SOA zainul.com. (domain anda.) root.zainul.com. ( (root.domain anda.)
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS zainul.com. (nama domain anda.)
1 (IP DNS anda) 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
# 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 dan network
# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
Stopping named: [ OK ]
Starting named: [ OK ]
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 ]
9. Cek dengan perintah :
# nslookup
> zainul.com (Domain yang anda buat)
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: zainul.com
Address: 192.168.21.1
> www.zainul.com (Sub domain yang anda buat)
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: www.zainul.com
Address: 192.168.21.1
> exit
# nslookup
> zainul.com (Domain yang anda buat)
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: zainul.com
Address: 192.168.21.1
> www.zainul.com (Sub domain yang anda buat)
Server: 192.168.21.1
Address: 192.168.21.1#53
Name: www.zainul.com
Address: 192.168.21.1
> exit
gan ko sya konfigurasi dns di fedora 9 ko gak bsa ngesave ya ...........
ad tmbl yg laen gak slain esc lalu ketik wq ??? lo ad yang laen ksih tw ane gan ......
dtnggu blannya scpt nya gan .............
@Anonim: bukanya pake nano jangan pake vi atau vim. Tapi install paketnya dulu.
mas, kalok RTO thu kenapa..??
@Anonim: Itu gak connect coba ping ip dns.
Kemudian restart network dan named.
makasih gan :)
tutorial anda sangat membantu sekali
kalo boleh request konfigurasi vsftpd di fedora19