Ubuntu-20.04에 Bind9 설치하기



  Environment
    Device : Odroid-HC2
    OS : Ubuntu-20.04
    Host Name : test
    Domain Name : test.com




1. Bind9 설치


$ sudo apt install bind9 dnsutils -y

2. Bind9 설정


1) 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
설정 추가
zone "test.com" {
        type master;
        file "/etc/bind/db.test.com";
};
2) named.conf.options 설정 (option)
$ sudo cp /etc/bind/named.conf.options /etc/bind/named.conf.options.orig
$ sudo nano /etc/bind/named.conf.option
3) DNS Database 생성
$ sudo nano /etc/bind/db.test.com
설정 추가
; 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