How to Install Bind9 on Ubuntu-20.04
======================================
Environment
Device : Odroid-HC2
OS : Ubuntu-20.04
Host Name : test
Domain Name : test.com
======================================
1. Install bind
$ sudo apt install bind9 dnsutils -y
2. Setup bind
1) Setup named.conf.local
$ sudo cp /etc/bind/named.conf /etc/bind/named.conf.orig
$ sudo cp /etc/bind/named.conf.local /etc/bind/named.conf.local.orig
$ sudo nano /etc/bind/named.conf.local
Insert Configuration
zone "test.com" {
type master;
file "/etc/bind/db.test.com";
};
2) Setup named.conf.options
$ sudo cp /etc/bind/named.conf.options /etc/bind/named.conf.options.orig
$ sudo nano /etc/bind/named.conf.option
3) Generate named.conf.options
$ sudo nano /etc/bind/db.test.com
Insert Configuration
; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL 86400
@ IN SOA test.com. root.test.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS ns.test.com.
@ IN A 192.168.101.100
@ IN AAAA ::1
ns IN A 192.168.101.100
test IN A 192.168.101.100
net IN A 192.168.101.210
net1 IN A 192.168.101.201
net2 IN A 192.168.101.202
$ sudo systemctl restart bind9
$ nslookup net.test.com 192.168.101.210