1.用yum安装Bind相关配置
# yum install bind-chroot
2.修改主配置文件(/etc/named.conf)
3.修改区域配置文件 (named.rfc1912.zones )
4.编辑数据配置文件。我们可以从/var/named目录中复制一份正向解析的模板文件(named.localhost),然后把域名和IP地址的对应数据填写数据配置文件中并保存
# cd /var/named/
# ls -al named.localhost
# cp -a named.localhost linuxprobe.com.zone
5.配置数据配置文件目录(/var/named)
6.在保存并退出后文件后记得重启named服务程序,让新的解析数据生效
# systemctl restart named
7.修改网卡配置
8.重启网卡nslookup命令用于检测能否从DNS服务器中查询到域名与IP地址的解析记
systemctl restart network
# nslookup
# nslookup
> www.123.com
Server: 192.168.162.140
Address: 192.168.162.140#53
Name: www.123.com
Address: 192.168.162.140
反向解析
1.编辑区域配置文件
# vim /etc/named.rfc1912.zones
2.编译数据配置文件
3.重启,测试
# systemctl restart named
# nslookup
> 192.168.162.140
Server: 192.168.162.140
Address: 192.168.162.140#53
140.162.168.192.in-addr.arpa name = bbs.123.com.
140.162.168.192.in-addr.arpa name = www.123.com.
140.162.168.192.in-addr.arpa name = mail.123.com.
140.162.168.192.in-addr.arpa name = ns.123.com.