Dns配置三(反向解析)
首先在 etc下的 vim named.rfc.1912.zones
配置 如图所示
zone "100.168.192.in-addr.arpa" {
type master;
file "192.168.100.zone";
}
第二步进入/var/named
cp -p named.localhost 192.168.100.zone
vim 192.168.100.zone
进入后编辑如图所示
$TTL 1D
@ IN SOA ns.ltest.com root.ltest.com (
0 ; serial
1D ; refresh
1H ;retry
1W ; expire
3H ) ;minimum
NS ns.ltest.com.
142 IN PTR ns.ltest.com.
144 IN PTR www.ltest.com
146 IN PTR ftp
然后使用如下 命令 检查是否有错
root@localhost named]# named-checkconf
[root@localhost named]# named-checkzone 100.168.192.in-addr.arpa /var/named/192.168.100.zone
zone 100.168.192.in-addr.arpa/IN: loaded serial 0
OK
重启
[root@localhost named]# rndc reload
然后解析 如下
[root@localhost named]# nslookup www.ltest.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: www.ltest.com
Address: 192.168.100.144
您在 /var/spool/mail/root 中有新邮件
[root@localhost named]# nslookup 192.168.100.142
142.100.168.192.in-addr.arpa name = ns.ltest.com.