1. Install Bind9
# apt install bind9 dnsutils
2. Create Zone File
# nano /etc/bind/named.conf.local
zone “smkn4tkj2023.sch.id” {
type master;
file “/etc/bind/db.smk”;
};
zone “10.10.10.in-addr.arpa” {
type master;
file “/etc/bind/rev.smk”;
};
3. Konfigurasi DNS Forwarder
# nano named.conf.options
options {
directory “/var/cache/bind”;
forwarders {
8.8.8.8,1.1.1.1;
};
};
4. Create Forward
# cp /etc/bind/db.local /etc/bind/db.smk
; BIND data file for local loopback interface
$TTL 604800
@ IN SOA smkn4tkj2023.sch.id. root.smkn4tkj2023.sch.id. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ IN NS ns1.smkn4tkj2023.sch.id.
@ IN A 10.10.10.2
ns1 IN A 10.10.10.2
srv2 IN A 10.10.10.2
ns2 IN A 10.10.10.1
www IN A 10.10.10.1
srv1 IN A 10.10.10.1
tkj IN A 10.10.10.1
admin IN A 10.10.10.1
file IN A 10.10.10.1
rtr IN A 10.10.10.6
fadel IN CNAME www.smkn4tkj2023.sch.id.
4. Create Reverse
# cp /etc/bind/db.127 /etc/bind/rev.smk
; BIND data file for local loopback interface
$TTL 604800
@ IN SOA smkn4tkj2023.sch.id. root.smkn4tkj2023.sch.id. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ IN NS ns1.smkn4tkj2023.sch.id.
2 IN PTR ns1.smkn4tkj2023.sch.id.
2 IN PTR smkn4tkj2023.sch.id.
2 IN PTR srv2.smkn4tkj2023.sch.id.
1 IN PTR ns2.smkn4tkj2023.sch.id.
1 IN PTR www.smkn4tkj2023.sch.id.
1 IN PTR srv1.smkn4tkj2023.sch.id.
1 IN PTR tkj.smkn4tkj2023.sch.id.
1 IN PTR admin.smkn4tkj2023.sch.id.
1 IN PTR file.smkn4tkj2023.sch.id.
6 IN PTR rtr.smkn4tkj2023.sch.id.
5. Verifikasi dan Ujicoba
# systemctl restart bind9
# nslookup 10.10.10.2
# nslookup smkn4tkj2023.sch.id