前提:
服务端ip:192.168.32.100
服务端代码:
第一步:安装bind
yum -y install bind
2.修改主配置文件
vim /etc/named.conf
3.修改区域配置文件
vim /etc/named.rfc1912.zones
4.配置正向解析数据文件
cd /var/named/
cp -p named.localhost example.com.zone
vim example.com.zone
5.配置逆向解析数据文件
cp -p example.com.zone 192.168.32.arpa
vim 192.168.32.arpa
6.校验解析结果
named-checkconf /etc/named.conf
named-checkconf /etc/named.rfc1912.zones
named-checkzone example.com /var/named/192.168.32.arpa
named-checkzone example.com /var/named/example.com.zone
systemctl start named
netstat -anput | grep LISTEN | grep 53
yum -y install httpd
vim /etc/httpd/conf/httpd.conf
7.重启服务
systemctl start httpd
systemctl stop firewalld
客户端代码:
vim /etc/resolv.conf
firefox www.example.com