Cara install DNS
sudo apt-get install bind9
komfigurasi DNS
IP Address yang saya gunakan 192.1.2.77 dengan nama domain hengki.info
$ sudo su
# cd /etc/bind/
# nano named.conf.local
tamabahkan skrip berikut ;
zone "hengki.info" { type master;
file "/etc/bind/db.hengki"; };
zone "1.168.192.in-addr.arpa" { type master; notify no;
file "/etc/bind/db.1";};
Penulisan IP pada baris zone "2.1.192.in-addr.arpa" ( ditulis terbalik.)
Copy file db.local
# cp db.local db.hengki
# cp db.local db.1
Edit db.hengki, scriptnya ;
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.hengki.info. root.hengki.info. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS hengki.info. ====>>(pada antara "@" dan "IN" di tab jika di spasi sering tidak berjalan)
@ IN A 192.1.2.77
ns IN A 192.1.2.77
www IN CNAME hengki.info.
Edit db.1, scriptnya ;
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.hengki.info. root.hengki.info. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS hengki.info.
1 IN PTR hengki.info.
ns IN PTR 192.1.2.77
www IN PTR 192.1.2.77
Tambahkan DNS-nameserver pada konfigurasi interface
# nano /etc/network/interfaces
dns-nameservers 192.1.2.77
dns-search hengki.info
Pengujian
$ nslookup hengki.info
Server: 192.1.2.77
Address: 192.1.2.77#53
Name: hengki.info
Address: 192.1.2.77
$ dig hengki.info
; <<>> DiG 9.8.1-P1 <<>> hengki.info
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45783
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;hengki.info. IN A
;; ANSWER SECTION:
hengki.info. 604800 IN A 192.1.2.77
;; AUTHORITY SECTION:
hengki.info. 604800 IN NS hengki.info.
;; Query time: 0 msec
;; SERVER: 192.1.2.77#53(192.1.2.77)
;; WHEN: Tue Apr 2 16:46:47 2013
;; MSG SIZE rcvd: 59