Pertama Langkah pertama konfigurasi adalah mengedit file /etc/bind/named.conf.options untuk menambahkan DNS Forward, disini saya gunakan DNS public dari google saja. root@lab13:~# nano /etc/bind/named.conf.options options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all0's placeholder. forwarders { 8.8.8.8; 8.8.4.4; }; authnxdomain no; # conform to RFC1035 listenonv6 { any; }; };
Kedua Lanjutkan dengan mengedit file /etc/bind/named.conf.local untuk menentukan zona DNS Record Local, saat mengedit sesuaikan zona yang akan dipakai sesuai kebutuhan atau kepentingan anda root@lab13:~# nano /etc/bind/named.conf.local // // 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 "lab13.com" { type master; file "/etc/bind/db.lab13.com"; }; zone "0.168.192.inaddr.arpa" { type master; file "/etc/bind/db.192"; }; include "/etc/bind/rndc.key";
Ketiga Dilanjutkan dengan menduplicate file db local sesuai dengan nama file yang disebutkan di /etc/bind/named.conf.local dengan mengetikkan perintah sebagai berikut : root@lab13:~# cp /etc/bind/db.local /etc/bind/db.lab13.com root@lab13:~# cp /etc/bind/db.local /etc/bind/db.192
Keempat Setelah di duplikat, saya lanjutkan dengan mengedit file /etc/bind/db.lab13.com root@lab13:~# nano /etc/bind/db.lab13.com ; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA ns.lab13.com. mail.lab13.com. ( 20100820 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; localhost IN A 127.0.0.1 @ IN NS ns.lab13.com. ns IN A 192.168.0.1 smtp IN CNAME ns
www IN CNAME ns
Kelima Dilanjutkan dengan mengedit file /etc/bind/db.192 root@lab13:~# nano /etc/bind/db.192 ; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA ns.lab13.com. mail.lab13.com ( 20100820 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns. 1 IN PTR ns.lab13.com. www IN CNAME ns
Keenam Setelah konfigurasi selesai lanjutkan dengan mengedit file /etc/hosts untuk mengaktifkan beberapa domain yang ingin diaktifkan sebagai host root@lab13:~# nano /etc/hosts 127.0.0.1 localhost 192.168.0.1 lab13 lab13.com
Ketujuh Setelah itu edit file /etc/resolv.conf root@lab13:~# nano /etc/resolv.conf search lab13.com nameserver 192.168.0.1
nameserver 127.0.0.1
Delapan Terakhir restart networking dan bind9 root@lab13:~# /etc/init.d/networking restart root@lab13:~# /etc/init.d/bind9 restart
Sembilan Install dnsutils untuk menguji bind9 dengan perintah sebagai berikut root@lab13:~# aptget install dnsutils
Sepuluh Lakukan checkzone untuk mengetest hasil konfigurasi kita pada file /etc/bind/db.lab13.com dan /etc/bind/db.192 root@lab13:~# namedcheckzone lab13.com /etc/bind/db.lab13.com zone lab13.com/IN: loaded serial 20100820 OK root@lab13:~# namedcheckzone lab13.com /etc/bind/db.192 zone lab13.com/IN: loaded serial 20100820 OK
Sebelas Lanjutkan dengan mengecek dengan menggunakan perintah dig, dimulai dari localhost root@lab13:~# dig localhost ; <<>> DiG 9.6.1P2 <<>> localhost ;; global options: +cmd ;; Got answer: ;; >>HEADER<< opcode: QUERY, status: NOERROR, id: 31417 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION:
;localhost. IN A ;; ANSWER SECTION: localhost. 604800 IN A 127.0.0.1 ;; AUTHORITY SECTION: localhost. 604800 IN NS localhost. ;; ADDITIONAL SECTION: localhost. 604800 IN AAAA ::1 ;; Query time: 0 msec ;; SERVER: 192.168.0.1#53(192.168.0.1) ;; WHEN: Fri Aug 20 08:25:26 2010 ;; MSG SIZE rcvd: 85
Tiga Belas Cek juga sambungan ke internet root@lab13:~# dig yahoo.com ; <<>> DiG 9.6.1P2 <<>> yahoo.com ;; global options: +cmd ;; Got answer: ;; >>HEADER<< opcode: QUERY, status: NOERROR, id: 60531 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 13, ADDITIONAL: 0 ;; QUESTION SECTION: ;yahoo.com. IN A ;; ANSWER SECTION: yahoo.com. 2396 IN A 72.30.2.43 yahoo.com. 2396 IN A 98.137.149.56 yahoo.com. 2396 IN A 209.191.122.70 yahoo.com. 2396 IN A 67.195.160.76 yahoo.com. 2396 IN A 69.147.125.65 ;; AUTHORITY SECTION: com. 172601 IN NS h.gtldservers.net. com. 172601 IN NS d.gtldservers.net. com. 172601 IN NS l.gtldservers.net. com. 172601 IN NS g.gtldservers.net. com. 172601 IN NS i.gtldservers.net. com. 172601 IN NS c.gtldservers.net. com. 172601 IN NS b.gtldservers.net.
com. 172601 IN NS f.gtldservers.net. com. 172601 IN NS m.gtldservers.net. com. 172601 IN NS e.gtldservers.net. com. 172601 IN NS j.gtldservers.net. com. 172601 IN NS a.gtldservers.net. com. 172601 IN NS k.gtldservers.net. ;; Query time: 62 msec ;; SERVER: 192.168.0.1#53(192.168.0.1) ;; WHEN: Fri Aug 20 08:29:00 2010 ;; MSG SIZE rcvd: 331
Tiga belas Atau bisa juga menggunakan nslookup untuk menguji root@lab13:~# nslookup > set type=any > lab13.com Server: 192.168.0.1 Address: 192.168.0.1#53 lab13.com nameserver = ns.lab13.com. lab13.com origin = ns.lab13.com mail addr = mail.lab13.com serial = 20100820 refresh = 604800 retry = 86400 expire = 2419200 minimum = 604800
Referensi http://numb.web.id/ubuntu-server/setting-dns-server-pada-ubuntu-server.html