Instal DNS
apt-get install bind9 dnsuttils
konfigurasikan file named.conf.local dan sesuaikan isinya
server:~# vim /etc/bind/named.conf.local
tambahkan bagian “zone” dan sesuaikan dengan soal
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "latihan.com" {
type master;
file "db.latihan.com";
};
zone "16.168.192.in-addr.arpa" {
type master;
file "db.16.168.192";
};
langkah berikutnya adalah copykan template forwarder dan reverse, gunakan perintah di bawah untuk melakukannya
server:~# cp /etc/bind/db.local /var/cache/bind/db.latihan.com
server:~# cp /etc/bind/db.127 /var/cache/bind/db.16.168.192
kemudian edit forwarder, dengan perintah
server:~# vim /var/cache/bind/db.latihan.com
konfigurasikan file forwarding
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA server.latihan.com. root.latihan.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS latihan.com.
@ IN A 192.168.16.1
@ IN MX 10 latihan.com.
server IN CNAME latihan.com.
mail IN CNAME latihan.com.
ftp IN CNAME latihan.com.
www IN CNAME latihan.com.
kemudian edit reverse, dengan perintah
server:~# vim /var/cache/bind/db.16.168.192
dan sesuaikan isinya
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA server.latihan.com. root.latihan.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS latihan.com.
1 IN PTR server.
1 IN PTR mail.
1 IN PTR www.
1 IN PTR ftp.
restart DNS server
server:~# /etc/init.d/bind9 restart
cek konfigurasi
operator:/home/adnan # dig latihan.com
; <<>> DiG 9.7.1 <<>> latihan.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52425
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;latihan.com. IN A
;; ANSWER SECTION:
latihan.com. 604800 IN A 192.168.16.1
;; AUTHORITY SECTION:
latihan.com. 604800 IN NS latihan.com.
;; Query time: 1 msec
;; SERVER: 192.168.16.1#53(192.168.16.1)
;; WHEN: Thu Oct 21 02:43:38 2010
;; MSG SIZE rcvd: 61
operator:/home/adnan # dig 192.168.16.1
; <<>> DiG 9.7.1 <<>> 192.168.16.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 49850
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;192.168.16.1. IN A
;; Query time: 4 msec
;; SERVER: 192.168.16.1#53(192.168.16.1)
;; WHEN: Thu Oct 21 02:44:14 2010
;; MSG SIZE rcvd: 30