Install and configure BIND

Install BIND to configure DNS server which resolves domain name or IP address.

[1] Install BIND.

[root@futurelinux ~]# dnf install bind bind-utils -y

[2] Configure BIND.

[root@futurelinux ~]# vi /etc/named.conf

options {
        listen-on port    53    { any; };     # change ( listen all )
        listen-on-v6 port 53    { any; };     # change ( listen all )

        directory               "/var/named";
        dump-file               "/var/named/data/cache_dump.db";
        secroots-file           "/var/named/data/named.secroots";
        recursing-file          "/var/named/data/named.recursing";
        statistics-file         "/var/named/data/named_stats.txt";
        memstatistics-file      "/var/named/data/named_mem_stats.txt";

        allow-query             { any; };
        allow-transfer          { none; };
...

[3] Create the following files.

[root@futurelinux ~]# touch /var/named/data/cache_dump.db
[root@futurelinux ~]# touch /var/named/data/named.secroots
[root@futurelinux ~]# touch /var/named/data/named.recursing
[root@futurelinux ~]# touch /var/named/data/named_stats.txt
[root@futurelinux ~]# touch /var/named/data/named_mem_stats.txt

[4] Set directory and file permissions.

[root@futurelinux ~]# chown named:named -R /var/named
[root@futurelinux ~]# chown named:named -R /run/named

[5] If SELinux is active, set up SELinux policies.

[root@futurelinux ~]# restorecon -R /var/named
[root@futurelinux ~]# restorecon -R /run/named

[6] Add the named service to startup services and start the service.

[root@futurelinux ~]# systemctl enable named
[root@futurelinux ~]# systemctl start named

[7] If firewalld is active, allow dns service.

[root@futurelinux ~]# firewall-cmd --permanent --add-service=dns
success
[root@futurelinux ~]# firewall-cmd --reload
success