搭建DNS

配置网卡
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
搭建DNS_第1张图片
重启网卡并查看
[root@localhost ~]# sysrtemctl restart network
[root@localhost ~]# ifconfig ens33
搭建DNS_第2张图片
安装bind bind-chroot
[root@localhost ~]# yum -y install bind bind-chroot
修改配置
[root@localhost ~]# vim /etc/named.conf
搭建DNS_第3张图片
[root@localhost ~]# vim /etc/named.rfc1912.zones
搭建DNS_第4张图片
移动到named下 做备份
[root@localhost ~]# cd /var/named/
[root@localhost ~]# cp -p named.localhost abc.com.zone
[root@localhost ~]# cp -p named.localhost 192.168.1.zone
[root@localhost ~]# vim abc.com.zone
搭建DNS_第5张图片
[root@localhost ~]# vim 192.168.1.zone
搭建DNS_第6张图片
检验
[root@localhost named]# named-checkzone abc.com.zone 192.168.1.zone
zone abc.com.zone/IN: loaded serial 0
OK
关闭防火墙,降低沙盒 并启动
[root@localhost named]# systemctl restart named
[root@localhost named]# systemctl stop firewalld
[root@localhost named]# setenforce 0
安装bind-utils
[root@localhost named]# yum -y install bind-utils
测试正反向解析
[root@localhost named]# nslookup www.abc.com
[root@localhost named]# nslookup 192.168.1.143
搭建DNS_第7张图片

你可能感兴趣的:(搭建DNS)