Debian 11: Install dan Konfigurasi DNS: Perbedaan antara revisi
Loncat ke navigasi
Loncat ke pencarian
Tidak ada ringkasan suntingan |
Tidak ada ringkasan suntingan |
||
(7 revisi perantara oleh pengguna yang sama tidak ditampilkan) | |||
Baris 6: | Baris 6: | ||
apt update | apt update | ||
apt install bind9 bind9utils bind9-doc | apt install bind9 bind9utils bind9-doc | ||
==Konfigurasi Local File== | ==Konfigurasi Local File== | ||
Baris 19: | Baris 11: | ||
Edit | Edit | ||
sudo | sudo nano /etc/bind/named.conf | ||
Di file ini kita bisa tambahkan forward dan | Di file ini kita bisa tambahkan forward dan reverse zone dari sebuah domain, contoh | ||
zone "robiehakim. | zone "robiehakim.net" { | ||
type master; | type master; | ||
file "/etc/bind/ | file "/etc/bind/forward"; | ||
}; | }; | ||
zone " | zone "14.13.12.in-addr.arpa" { | ||
type master; | type master; | ||
file "/etc/bind/ | notify no; | ||
file "/etc/bind/reverse"; | |||
}; | }; | ||
== | == Mengcopy dan Edit file konfigurasi == | ||
Pertama copy file db.local dengan mengetikkan perintah | |||
#cp /etc/bind/db.local /etc/binforward | |||
lalu edit file bagian ini | |||
; | |||
; BIND data file for local loopback interface | |||
; | |||
$TTL 604800 | $TTL 604800 | ||
@ IN SOA | @ IN SOA robiehakim.net. root.robiehakim.net. ( | ||
2 ; Serial | 2 ; Serial | ||
604800 ; Refresh | 604800 ; Refresh | ||
Baris 54: | Baris 46: | ||
604800 ) ; Negative Cache TTL | 604800 ) ; Negative Cache TTL | ||
; | ; | ||
@ IN NS | @ IN NS robiehakim.net. | ||
@ IN A | @ IN A 12.13.14.32 #(sesuaikan dengan ip server / vm) | ||
@ IN AAAA ::1 | @ IN AAAA ::1 | ||
#cp /etc/bind/db.123 /etc/bin/reverse | |||
lalu edit file bagian ini | |||
; | |||
; BIND reverse data file for local loopback interface | |||
; | |||
$TTL 604800 | $TTL 604800 | ||
@ IN SOA | @ IN SOA robiehakim.net. root.robiehakim.net. ( | ||
1 ; Serial | |||
604800 ; Refresh | |||
86400 ; Retry | |||
2419200 ; Expire | |||
604800 ) ; Negative Cache TTL | |||
; | ; | ||
@ IN NS robiehakim.net. | |||
IN NS | 32 IN PTR robiehakim.net. | ||
==Tambahkan IP Server ke file resolve.conf== | |||
#nano /etc/resolv.conf | |||
nameserver 12.13.14.32 | |||
==Restart BIND== | ==Restart BIND== | ||
Baris 97: | Baris 83: | ||
Restart | Restart | ||
systemctl restart bind9 | |||
Lihat hasil dengan mengetikkan perintah di terminal | Lihat hasil dengan mengetikkan perintah di terminal | ||
dig robiehakim.net @localhost (enter) | |||
< | ; <<>> DiG 9.16.44-Debian <<>> robiehakim.net | ||
;; global options: +cmd | |||
;; Got answer: | |||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56404 | |||
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 | |||
;; OPT PSEUDOSECTION: | |||
; EDNS: version: 0, flags:; udp: 1232 | |||
; COOKIE: 59973bf45d5296e50100000065a936f48d3598f288cbd081 (good) | |||
;; QUESTION SECTION: | |||
;robiehakim.net. IN A | |||
;; ANSWER SECTION: | |||
robiehakim.net. 604800 IN A 12.13.14.32 | |||
;; Query time: 0 msec | |||
;; SERVER: 12.13.14.32#53(12.13.14.32) | |||
;; WHEN: Thu Jan 18 21:34:28 WIB 2024 | |||
;; MSG SIZE rcvd: 87 | |||
nslookup robiehakim.net @localhost (enter) | |||
Server: 12.13.14.32 | |||
Address: 12.13.14.32#53 | |||
Name: robiehakim.net | |||
Address: 12.13.14.32 | |||
Name: robiehakim.net | |||
Address: ::1 | |||
[[Kategori:Linux]] |
Revisi terkini sejak 18 Januari 2024 14.58
Install BIND
install BIND
sudo su apt update apt install bind9 bind9utils bind9-doc
Konfigurasi Local File
Edit
sudo nano /etc/bind/named.conf
Di file ini kita bisa tambahkan forward dan reverse zone dari sebuah domain, contoh
zone "robiehakim.net" { type master; file "/etc/bind/forward"; };
zone "14.13.12.in-addr.arpa" { type master; notify no; file "/etc/bind/reverse"; };
Mengcopy dan Edit file konfigurasi
Pertama copy file db.local dengan mengetikkan perintah
#cp /etc/bind/db.local /etc/binforward
lalu edit file bagian ini
; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA robiehakim.net. root.robiehakim.net. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS robiehakim.net. @ IN A 12.13.14.32 #(sesuaikan dengan ip server / vm) @ IN AAAA ::1
#cp /etc/bind/db.123 /etc/bin/reverse
lalu edit file bagian ini
; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA robiehakim.net. root.robiehakim.net. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS robiehakim.net. 32 IN PTR robiehakim.net.
Tambahkan IP Server ke file resolve.conf
#nano /etc/resolv.conf
nameserver 12.13.14.32
Restart BIND
Restart
systemctl restart bind9
Lihat hasil dengan mengetikkan perintah di terminal
dig robiehakim.net @localhost (enter)
; <<>> DiG 9.16.44-Debian <<>> robiehakim.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56404 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ; COOKIE: 59973bf45d5296e50100000065a936f48d3598f288cbd081 (good) ;; QUESTION SECTION: ;robiehakim.net. IN A ;; ANSWER SECTION: robiehakim.net. 604800 IN A 12.13.14.32 ;; Query time: 0 msec ;; SERVER: 12.13.14.32#53(12.13.14.32) ;; WHEN: Thu Jan 18 21:34:28 WIB 2024 ;; MSG SIZE rcvd: 87
nslookup robiehakim.net @localhost (enter)
Server: 12.13.14.32 Address: 12.13.14.32#53 Name: robiehakim.net Address: 12.13.14.32 Name: robiehakim.net Address: ::1