一:安装DNS
yum install bind #安装DNS
yum install bind-utils #安装nslookup
二:修改主配置文件,添加正反向域
vim /etc/named.conf #编辑主配置文件
listen-on port 53 { any; } #修改为any
allow-query { any; } #修改为any
#主配置文件底下添加正反向域
named-checkconf #检查配置是否正确
#添加正向解析
cp /var/named/named.localhost /var/named/jj.com.zone
chown root:named /var/named/jj.com.zone
vim /var/named/jj.com.zone
#添加反向解析
cp /var/named/named.localhost /var/named/172.16.0.arpa
chown root:named /var/named/172.16.0.arpa
vim /var/named/172.16.0.arpa
#检查配置是否正常
named-checkzone "rj.com" /var/named/rj.com.zone
named-checkzone "172.16.0.in-addr.arpa" /var/named/172.16.0.arpa
systemctl restart named.service #重启DNS
三:正反向解析DNS
解析正反向域
正向域
反向域
四:DNS删除,重启,查看
yum autoremove bind #删除DNS
systemctl restart named.service #重启DNS
systemctl start named.service #启动DNS
systemctl status named.service #查看DNS状态
原文地址:https://www.cnblogs.com/intelligent-/p/10847189.html