标签:DNS
centos7.4安装 DNS 服务器DNS服务器ip为 192.168.221.10(关闭防火墙)
DNS客户端ip为 192.168.221.20
yum install bind -y
// 修改
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
allow-query { any; };
// 增加
zone "apeng.com." IN {
type master;
file "apeng.com.zone";
};
[root@localhost ~]# vim /etc/named.conf
[root@localhost named]# cp -p named.localhost apeng.com.zone
[root@localhost named]# vim apeng.com.zone
[root@localhost named]# systemctl start named
DNS 客户端访问
将 DNS 修改为 192.168.221.10
[root@apenglinux-002 ~]# sed -ri ‘/DNS1/c\DNS1=192.168.221.10‘ /etc/sysconfig/network-scripts/ifcfg-ens33
[root@apenglinux-002 ~]# systemctl restart network
设置 DNS 转发
// 在 DNS 服务器上设置
[root@localhost named]# vim /etc/named.conf // 注释掉 zone,加上以下两行
forward only;
forwarders { 8.8.8.8; };
[root@localhost named]# systemctl restart named
在dns客户端访问
标签:DNS
原文地址:http://blog.51cto.com/13480443/2094795