标签:sys 需要 dns systemctl start 解决 install 判断 gre
关闭防火墙 selinux
systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service #关闭开机自启
setenforce 0 #临时解决selinux
sed -i ‘s/^SELINUX=.*$/SELINUX=disabled/g‘ /etc/selinux/config #完全关闭 需要重启
判断是否安装bind (存在即安装)
[root@bogon named]# rpm -qa | grep ‘bind‘
bind-chroot-9.11.4-16.P2.el7_8.6.x86_64
bind-utils-9.11.4-16.P2.el7_8.6.x86_64
安装DNS服务
yum install bind-chroot bind-utils -y #安装
systemctl start named-chroot #启动
systemctl enable named-chroot #开机启动
配置/etc/named.conf(主配置文件)
vim /etc/named.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
options {
listen-on port 53 { 192.168.10.100; }; #改IP
……
allow-query { any; }; #允许任何人
配置/etc/named.rfc1912.zones (添加解析记录 在最后加)
vim /etc/named.rfc1912.zones
~~~~~~~~~~~~~~~~~
zone "qq.com" IN {
type master;
file "qq.com.zone";
};
添加/var/named/qq.com.zone (添加解析文件 直接创建)
vim /var/named/qq.com.zone
~~~~~~~~~~~~~~~~~~~~~~~
$TTL 1D
@ IN SOA qq.com. root (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS qq.com.
IN A 192.168.10.100
www IN A 192.168.10.100
* IN A 192.168.10.111
配置文件权限,重启服务
chown root:named qq.com.zone # 配置权限
systemctl restart named-chroot # 重启服务
标签:sys 需要 dns systemctl start 解决 install 判断 gre
原文地址:https://www.cnblogs.com/yuekesss/p/13539173.html