DNS反向解析
配置反向解析,可以在之前的正向解析基础上进行修改,我们进入区域配置文件修改
首先打开named.rfc1912.zones我们在第32行添加
[root@localhost ~]# vi /etc/named.rfc1912.zones
24
25 zone "test.com" IN {
26 type master;
27 file "test.com.zone";
28 allow-update { none; };
29 };
30
31 zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
32
33 zone "88.168.192.in-addr.arpa" IN {
34 type master;
35 file "test.com.local";
36 allow-update { none; };
37 };
然后我们再创建区域数据配置文件,进行配置
[root@localhost ~]# cd /var/named/
[root@localhost named]# cp -p test.com.zone test.com.local
修改
[root@localhost named]# vi test.com.local
$TTL 1D
@ IN SOA test.com admin.test.com.. (
//这边注意,将@改成test.com 0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS test.com //这边注意,将@改成test.com
A 127.0.0.1
88 IN PTR www.test.com
启动验证
[root@localhost named]# systemctl restart named
[root@localhost named]# host 192.168.88.88 ///解析到了///
88.88.168.192.in-addr.arpa domain name pointer www.test.com.