Pendahuluan
dnsmasq adalah software open source yang digunakan untuk menyediakan layanan seperti DNS, DCHP, TFTP, router advertisement, dan network boot. dnsmasq ditujukan untuk jaringan skala kecil - menengah.
Panduan
-
Pasang dnsmasq
- Debian Based
sudo apt update sudo apt install -y dnsmasq
- RHEL Based
sudo yum update sudo yum install -y dnsmasq # atau sudo dnf update sudo dnf install -y dnsmasq
-
Buat file konfigurasi
# sudo vim /etc/dnsmasq.d/<name_file>.conf
sudo vim /etc/dnsmasq.d/contoh.conf
Record
- A = contoh.com 192.168.10.80
- CNAME = blog.contoh.com contoh.com
address=/contoh.com/192.168.10.80
cname=blog.contoh.com,contoh.com
Upstream DNS/DNS Forwarding
server=1.1.1.1
server=8.8.8.8
- Restart servis
systemctl daemon-reload
systemctl restart dnsmasq
-
Uji coba
- Atur /etc/resolv.conf
nameserver 192.168.10.80
- Permintaan DNS
[root@dnshost ~]# nslookup blog.contoh.com Server: 192.168.10.80 Address: 192.168.10.80#53 blog.contoh.com canonical name = contoh.com. Name: contoh.com Address: 192.168.10.80