Modul 04 · Layanan Jaringan

Instalasi DNS Server (BIND9)

DNS menerjemahkan nama domain (mis. www.tjktone.sch.id) menjadi IP address, dan sebaliknya. Modul ini memakai contoh domain tjktone.sch.id dengan server di 192.168.10.1.

1 Instal BIND9

root@debian:~#
apt update
apt install bind9 bind9utils dnsutils -y

2 Daftarkan zona di named.conf.local

nano /etc/bind/named.conf.local
zone "tjktone.sch.id" {
    type master;
    file "/etc/bind/db.tjktone.sch.id";
};

zone "10.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/db.192";
};

3 Buat forward zone

root@debian:~#
cp /etc/bind/db.local /etc/bind/db.tjktone.sch.id
nano /etc/bind/db.tjktone.sch.id
/etc/bind/db.tjktone.sch.id
$TTL    604800
@       IN      SOA     ns.tjktone.sch.id. admin.tjktone.sch.id. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

@       IN      NS      ns.tjktone.sch.id.
ns      IN      A       192.168.10.1
www     IN      A       192.168.10.1
mail    IN      A       192.168.10.1

4 Buat reverse zone

root@debian:~#
cp /etc/bind/db.127 /etc/bind/db.192
nano /etc/bind/db.192
/etc/bind/db.192
$TTL    604800
@       IN      SOA     ns.tjktone.sch.id. admin.tjktone.sch.id. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

@       IN      NS      ns.tjktone.sch.id.
1       IN      PTR     ns.tjktone.sch.id.

5 Cek konfigurasi & restart

root@debian:~#
named-checkconf
named-checkzone tjktone.sch.id /etc/bind/db.tjktone.sch.id
named-checkzone 10.168.192.in-addr.arpa /etc/bind/db.192

systemctl restart bind9
systemctl enable bind9

6 Arahkan resolver server ke dirinya sendiri

nano /etc/resolv.conf
nameserver 127.0.0.1
search tjktone.sch.id

7 Pengujian

root@debian:~#
nslookup www.tjktone.sch.id 192.168.10.1
dig ns.tjktone.sch.id
nslookup 192.168.10.1

Jika www.tjktone.sch.id berhasil resolve ke 192.168.10.1, dan reverse lookup mengembalikan ns.tjktone.sch.id, DNS server sudah berjalan.