[root@centos8 ~]#cat /etc/redhat-release CentOS Linux release 8.4.2105 [root@centos8 ~]#yum install -y bind [root@centos8 ~]#systemctl enable --now named
[root@centos8 ~]#vim /etc/named.conf options { listen-on port 53 { localhost; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; secroots-file "/var/named/data/named.secroots"; recursing-file "/var/named/data/named.recursing"; allow-query { any; };
不关闭的服务同时,重新加载服务
[root@centos8 ~]#rndc reload server reload successful
清除缓存
rndc flush
vim /etc/sysconfig/network-scripts/ifcfg- DNS1=10.0.0.5 nmcli con reload nmcli con up enxxx
测试
yum install -y bind-utils