Debian: Konfigurasi Debian 10 bind9: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Update repository | |||
<syntaxhighlight lang="bash"> | |||
sudo apt update | sudo apt update | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Install package bind9<syntaxhighlight lang="bash"> | Install package bind9 | ||
<syntaxhighlight lang="bash"> | |||
sudo apt install bind9 bind9utils bind9-doc bind9-host dnsutils | sudo apt install bind9 bind9utils bind9-doc bind9-host dnsutils | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Lihat status bind9<syntaxhighlight lang="bash"> | Lihat status bind9 | ||
<syntaxhighlight lang="bash"> | |||
systemctl status bind9 | systemctl status bind9 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Keterangan jika sudah berjalan<syntaxhighlight lang="bash">● bind9.service - BIND Domain Name Server | Keterangan jika sudah berjalan | ||
<syntaxhighlight lang="bash">● bind9.service - BIND Domain Name Server | |||
Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: en | Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: en | ||
Active: active (running) since Sun 2019-07-14 10:27:56 UTC; 4min 6s ago | Active: active (running) since Sun 2019-07-14 10:27:56 UTC; 4min 6s ago | ||
| Line 21: | Line 27: | ||
Memory: 13.7M | Memory: 13.7M | ||
CGroup: /system.slice/bind9.service | CGroup: /system.slice/bind9.service | ||
└─1481 /usr/sbin/named -u bind</syntaxhighlight> | └─1481 /usr/sbin/named -u bind | ||
</syntaxhighlight> | |||
Jika belum berjalan, masukkan perintah berikut | |||
<syntaxhighlight lang="bash"> | |||
sudo systemctl start bind9 | sudo systemctl start bind9 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Aktifkan otomatis saat booting<syntaxhighlight lang="bash"> | Aktifkan otomatis saat booting | ||
<syntaxhighlight lang="bash"> | |||
sudo systemctl enable bind9 | sudo systemctl enable bind9 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Edit file <code>named.conf.option</code> untuk mengizinkan menjadi DNS server<syntaxhighlight lang="bash"> | Edit file <code>named.conf.option</code> untuk mengizinkan menjadi DNS server | ||
<syntaxhighlight lang="bash"> | |||
vim /etc/bind/named.conf.options | vim /etc/bind/named.conf.options | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Tambahkan perintah ini<syntaxhighlight lang="bash" line="1"> | Tambahkan perintah ini | ||
<syntaxhighlight lang="bash" line="1"> | |||
options { | options { | ||
directory "/var/cache/bind"; | directory "/var/cache/bind"; | ||
| Line 65: | Line 80: | ||
}; | }; | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
sudo named-checkconf | sudo named-checkconf | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
sudo systemctl restart bind9 | sudo systemctl restart bind9 | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
nano /etc/bind/named.conf.local | nano /etc/bind/named.conf.local | ||
</syntaxhighlight><syntaxhighlight lang="bash" line="1"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" line="1"> | |||
// | // | ||
// Do any local configuration here | // Do any local configuration here | ||
| Line 86: | Line 109: | ||
}; | }; | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
cp /etc/bind/db.empty /etc/bind/db.example.com | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
nano /etc/bind/db.example.com | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
; | ; | ||
; BIND data file for local loopback interface | ; BIND data file for local loopback interface | ||
| Line 110: | Line 136: | ||
ns2 IN NS 192.168.100.60 | ns2 IN NS 192.168.100.60 | ||
@ IN A 192.168.100.60 | @ IN A 192.168.100.60 | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
named-checkconf | named-checkconf | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
named-checkzone example.com /etc/bind/db.example.com | named-checkzone example.com /etc/bind/db.example.com | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
zone example.com/IN: loaded serial 2019011503 | zone example.com/IN: loaded serial 2019011503 | ||
OK | OK | ||
</syntaxhighlight><syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | |||
systemctl restart bind9 | systemctl restart bind9 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:SMK 2024-25]] | |||
[[Category:Debian]] | |||
[[Category:Linux]] | |||