DNS Server Debian 10


1. Konfigurasi IP Address

Edit file konfigurasi network interface:

sudo nano /etc/network/interfaces

Isi seperti ini:

# The Primary Network Interfaces

auto enp0s3

iface enp0s3 inet static

address 192.168.19.1/24

Lalu restart network:

/etc/init.d/networking restart

Cek dengan:

ip a 


2. Update Repository 

update repository

apt-cdrom add

masukan DVD 1 2 3 secara bergantian

setiap pergantian DVD ketikan eject

kemudian apt-get update && upgrade


3. Konfigurasi named.conf.local

sebelum edit cd /etc/bind/

cp db.local for

cp db.127 rev

Edit file:

sudo nano /etc/bind/named.conf.local

Tambahkan zone:

zone "richan.net" {

    type master;

    file "/etc/bind/for";

};

 

zone "19.168.192.in-addr.arpa" {

    type master;

    file "/etc/bind/rev";

};


4. Buat File Forward Zone

nano for

Isi:

$TTL    604800

@       IN      SOA     richan.net. root.richan.net. (

                        2025091901 ; Serial

                        604800     ; Refresh

                        86400      ; Retry

                        2419200    ; Expire

                        604800 )   ; Negative Cache TTL

 

@       IN      NS      richan.net.

@       IN      A       192.168.19.1

www     IN      A       192.168.19.1

smk     IN      A       192.168.19.1


5. Buat File Reverse Zone

nano rev

Isi:

$TTL    604800

@       IN      SOA     richan.net. root.richan.net. (

                        2025091901 ; Serial

                        604800     ; Refresh

                        86400      ; Retry

                        2419200    ; Expire

                        604800 )   ; Negative Cache TTL

 

@       IN      NS      richan.net.

1       IN      PTR     richan.net.

1       IN      PTR     www.richan.net.

1       IN      PTR     smk.richan.net.


6. Edit resolv.conf

Atur agar menggunakan DNS server kita sendiri:

sudo nano /etc/resolv.conf

Isi:

nameserver 192.168.19.1

domain richan.net

search richan.net


7. Cek Konfigurasi BIND

Jika OK, restart bind:

/etc/init.d/bind9 restart atau 

sudo systemctl restart bind9

sudo systemctl enable bind9


8. Uji DNS Menggunakan nslookup

Test forward:

nslookup richan.net

nslookup smk.richan.net

Test reverse:

nslookup 192.168.19.1

Hasil yang diharapkan:

richan.net → 192.168.19.1

smk.richan.net → 192.168.19.1

192.168.19.1 → richan.net


Rangkuman

✅ IP Address → /etc/network/interfaces
✅ Install Paket → bind9 & dnsutils
✅ Konfigurasi Zone → /etc/bind/named.conf.local
✅ Forward Zone → /etc/bind/for
✅ Reverse Zone → /etc/bind/rev
✅ resolv.conf pakai nameserver 192.168.19.1
✅ Tes DNS → nslookup richan.net


 


No comments:

Post a Comment