DNS泛解析 server can't find 100.17.16.172.in-addr.arpa: SERVFAIL

Q:域名泛解析,反向代理失败

[root@jiangshan /]# nslookup 172.16.17.100
Server:        172.16.17.1
Address:    172.16.17.1#53

** server can't find 100.17.16.172.in-addr.arpa: SERVFAIL

S:服务配置过程如下:

1.主配置文件和区配置文件
#vim /etc/named.conf

zone "tt.com" IN {

        type master;
        file "tt.com.zone";
};
zone "17.16.172.in-addr.arpa" IN {
        type master;
        file "tt.com.arpa";

};

# vim /var/named/tt.com.zone

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
@       A       172.16.17.1

$GENERATE 100-200 stu$ A 172.16.17.$


# vim /var/named/tt.com.arpa  

                      

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
@       A       172.16.17.1
$GENERATE 100-200 $ PTR stu$.tt.com.

2.启动服务

#service named restart

-----启动成功

3.测试:

[root@jiangshan /]# nslookup stu100.tt.com
Server:        172.16.17.1
Address:    172.16.17.1#53

Name:    stu100.tt.com
Address: 172.16.17.100

[root@jiangshan /]# nslookup 172.16.17.100
Server:        172.16.17.1
Address:    172.16.17.1#53

** server can't find 100.17.16.172.in-addr.arpa: SERVFAIL

                 

查看/var/log/messages

#vim /var/log/messages

Oct 11 10:45:50 jiangshan named[8977]: zone 17.16.172.in-addr.arpa/IN: loading from master file tt.com.arpa failed: permission denied
Oct 11 10:45:50 jiangshan named[8977]: zone 17.16.172.in-addr.arpa/IN: not loaded due to errors.


是因为权限不够

给目录加777权限,文件加665权限

  [root@jiangshan /]# chmod 665 /var/named/tt.com.arpa

[root@jiangshan /]# chmod 777 /var/named

[root@jiangshan /]# service named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ]

[root@jiangshan /]# nslookup 172.16.17.100
Server:        172.16.17.1
Address:    172.16.17.1#53

100.17.16.172.in-addr.arpa    name = stu100.tt.com.

                                                    
~                  

你可能感兴趣的:(linux,DNS)