# Konfigurasi DNS Server

1. Jadikan root user

```
sudo su
```

2. Lakukan update terlebih dahulu

```
apt-get update
```

3. Install bind9 dan dnsutils

```
apt-get install bind9 dnsutils -y
```

4. Cek ip address server

```
ip a
```

disini ip address menunjukkan 192.168.1.33

<figure><img src="/files/Soz2y5OdR0GLvr2tcW3Z" alt=""><figcaption><p>Berikut IP addresnya</p></figcaption></figure>

5. Pergi ke direktori /etc/bind

```
cd /etc/bind
ls 
```

setelah menjalankan command "ls", akan terlihat isi dari direktori /etc/bind

<figure><img src="/files/W7MzpdLhIudJ9A6ETwao" alt=""><figcaption></figcaption></figure>

6. Edit file named.conf.local

```
nano named.conf.local
```

Lalu tambahkan zone untuk domain nya

```
zone "drizqi.org" {
        type master;
        file "/etc/bind/db.domain";
};

zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.ip";
};
```

* "drizqi.org" = contoh domain yang akan dipakai nantinya
* "1.168.192.in-addr.arpa" = IP address server secara terbalik dan menghilangkan ip terakhir. Contoh tadi IP nya 192.168.1.133 maka ditulis terbalik dan menghilangkan 133 sehingga menjadi 1.168.192
* file "/etc/bind/db.domain"; = file konfigurasi untuk domain
* file "/etc/bind/db.ip"; = file konfigurasi untuk IP

Setelah ditambahkan, hasilnya akan seperti ini :

<figure><img src="/files/koHFphITlClx5knItQ1E" alt=""><figcaption></figcaption></figure>

Jangan lupa untuk menyimpan dengan cara ctrl+x => y => enter

7. Buat duplikat file db.local dan ubah nama menjadi db.domain

```
cp db.local db.domain
```

8. Buat juga duplikat file db.127 dan ubah nama menjad db.ip

```
cp db.127 db.ip
```

9. Edit file db.domain

```
nano db.domain
```

Setalah itu, ubah localhost menjadi domain tadi dan 127.0.0.1 menjadi ip server. Seperti gambar dan syntax dibawah :

```
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     drizqi.org. root.drizqi.org. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      drizqi.org.
@       IN      A       192.168.1.133
```

Sebelum

<figure><img src="/files/dfPvllw0Qe9uyejShVkl" alt=""><figcaption></figcaption></figure>

Sesudah

<figure><img src="/files/b6A08yX0lKqm90uOdsc7" alt=""><figcaption></figcaption></figure>

Jangan lupa untuk menyimpan dengan cara ctrl+x => y => enter

10. Edit file db.ip

```
nano db.ip
```

Ubah localhost menjadi domain tadi dan 1.0.0 menjadi belakang IP address yaitu 133 (192.168.1.133), seperti syntax dibawah

```
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     drizqi.org. root.drizqi.org. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      drizqi.org.
133     IN      PTR     drizqi.org.
```

Sebelum

<figure><img src="/files/CEeBiw3phhQrQ6LpOTlS" alt=""><figcaption></figcaption></figure>

Sesudah

<figure><img src="/files/H5dhSqT71dDwt7jjbYrW" alt=""><figcaption></figcaption></figure>

Jangan lupa untuk menyimpan dengan cara ctrl+x => y => enter

11. Edit file resolv.conf

```
nano /etc/resolve.conf
```

Ubah nameserver menjadi IP address server

<figure><img src="/files/VfIwvSWctaEMcwFms0DO" alt=""><figcaption></figcaption></figure>

Jangan lupa untuk menyimpan dengan cara ctrl+x => y => enter

12. Restart bind9

```
systemctl restart bind9
```

lalu kita cek statusnya, pastikan sudah running

```
systemctl status bind9
```

<figure><img src="/files/za04RErcy2jaOQqmgal4" alt=""><figcaption></figcaption></figure>

Untuk keluar gunakan ctrl+c

13. &#x20;Cek apakah sudah berhasil, dengan cara nslookup IP dan domain tadi

```
nslookup 192.168.1.133
```

<figure><img src="/files/oPKhaz99f4NK2nqXZDbc" alt=""><figcaption></figcaption></figure>

```
nslookup drizqi.org
```

<figure><img src="/files/6hmrXSe1aFURkAZMGQmA" alt=""><figcaption></figcaption></figure>

Terlihat domain dan IP addres sudah terhubung

14. &#x20;Coba ping IP address dan domain

```
ping 192.168.1.133
```

<figure><img src="/files/mvZiHDKoSHkH34IoZw8X" alt=""><figcaption></figcaption></figure>

```
ping drizqi.org
```

<figure><img src="/files/y0dc7j1D7IxLau1hNkfw" alt=""><figcaption></figcaption></figure>

Ping berhasil. Dengan begitu konfigurasi DNS server berhasil


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devops.my.id/cloud-computing/konfigurasi-dns-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
