如何将域添加到PTR分辨率?

我有一个bind9服务器权威为我的域example.com 。 正向parsing工作,PTR以及一点。

我现在有

 254.10.10 IN PTR srv. 

在我的PTR区10.x ,正确地解决

 root@srv ~# dig -x 10.10.10.254 (...) ;; ANSWER SECTION: 254.10.10.10.in-addr.arpa. 604800 IN PTR srv. 

我希望决议是一个FQDN,因此取代srv. 通过在上面的configurationsrv (删除点),导致解决

 root@srv ~# dig -x 10.10.10.254 (...) ;; ANSWER SECTION: 254.10.10.10.in-addr.arpa. 604800 IN PTR srv.10.in-addr.arpa. 

如何通知bind9将10.10.10.254parsing为srv.example.com而不是srv.10.in-addr.arpa

注:我知道我可以

 254.10.10 IN PTR srv.example.com. 

在我的configuration。 我正在寻找的是如何设置默认的附加域。

据我所知,Bind只会附加/replace隐含的区域名称10.10.10.in-addr.arpa.$ORIGIN (通常也是区域名称10.10.10.in-addr.arpa. )的显式值 缺less或者使用了@简写。

您将需要使用FQDN,不能使用任何简写。

或者更确切地说,你不能期望使用不同的简写来用于资源logging,而且它是有价值的。

典型的反向区域如下所示:

 $ORIGIN 1.0.10.in-addr.arpa. $TTL 86400 @ IN SOA dns1.example.com. hostmaster.example.com. ( 2001062501 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ) ; minimum TTL of 1 day IN NS dns1.example.com. IN NS dns2.example.com. 20 IN PTR alice.example.com. 21 IN PTR betty.example.com. 22 IN PTR charlie.example.com. 23 IN PTR doug.example.com. 24 IN PTR ernest.example.com. 25 IN PTR fanny.example.com. 

你可以做的是改变/重新定义$ORIGIN – 被使用/追加到非限定logging的域名,比如那些只有主机名的域名。 你甚至可以多次更改$ ORIGIN …

虽然技术上这应该按照预期工作,但这是一种非常不寻常的方法,可能会引入人为错误,并且总体上是一个坏主意TM

以下意味着您不能再使用25 ,但需要使用FQDN 25.1.0.10.in-addr.arpa. 作为RR,但可以使用短主机名作为实际的主机。

 $ORIGIN 1.0.10.in-addr.arpa. $TTL 86400 @ IN SOA dns1.example.com. hostmaster.example.com. ( 2001062501 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ) ; minimum TTL of 1 day IN NS dns1.example.com. IN NS dns2.example.com. $ORIGIN example.com. 20.1.0.10.in-addr.arpa. IN PTR alice 21.1.0.10.in-addr.arpa. IN PTR betty 22.1.0.10.in-addr.arpa. IN PTR charlie 23.1.0.10.in-addr.arpa. IN PTR doug 24.1.0.10.in-addr.arpa. IN PTR ernest 25.1.0.10.in-addr.arpa. IN PTR fanny $ORIGIN example.co.uk. 26.1.0.10.in-addr.arpa. IN PTR geoff 27.1.0.10.in-addr.arpa. IN PTR honey 

你需要编辑/etc/bind/named.conf.local添加你的addr PTR区域:

zone "9.0.10.in-addr.arpa" { type master; file "/etc/bind/db.10.10.10"; };

创build文件db.10.10.10 vi db.10.10.10

添加这个: $TTL 3D @ IN SOA srv.example.com. root.example.com. ( 2 ; Serial 8H ; Refresh 2H ; Retry 4W ; Expire 1D) ; Minimum TTL @ IN NS srv.example.com. 254 IN PTR srv.example.com. $TTL 3D @ IN SOA srv.example.com. root.example.com. ( 2 ; Serial 8H ; Refresh 2H ; Retry 4W ; Expire 1D) ; Minimum TTL @ IN NS srv.example.com. 254 IN PTR srv.example.com. 重新启动bind9 /etc/init.d/bind9 restart

请使用nslookup -q=PTR 10.10.10.254检查