royun53 发表于 2006-12-25 10:51:13

关于Linux 的反向解析问题,困扰我好久了!!!!

--------------------------------------------------------------------------------

正向解析一切正常,反向解析总是提示失败!

主配置文件:
# vi /etc/named.conf


options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

zone "xaxj.com" IN {
type master;
file "xaxj.com.db";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "com.xaxj.db";
allow-update { none; };
};
include "/etc/rndc.key";

正解文件:


# vi xaxj.com.db
$TTL 86400
$ORIGIN xaxj.com.
@ IN SOA dns.xaxj.com. root.dns.xaxj.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

@ IN NS dns.xaxj.com.
dns IN A 192.168.1.254

反解文件:


# vi com.xaxj.db
$TTL 86400
$ORIGIN xaxj.com.
@ IN SOA dns.xaxj.com. root.dns.xaxj.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS dns.xaxj.com.

254 IN PTR dns.xaxj.com.

测试结果:


# nslookup
> dns.xaxj.com
Server: 192.168.1.254
Address: 192.168.1.254#53

Name: dns.xaxj.com
Address: 192.168.1.254
> 192.168.1.254
Server: 192.168.1.254
Address: 192.168.1.254#53

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

日志记录:
# tail -10 /var/log/messages
Dec 25 10:59:53 XAXJ named: listening on IPv4 interface eth0, 192.168.1.254#53
Dec 25 10:59:53 XAXJ named: command channel listening on 127.0.0.1#953
Dec 25 10:59:53 XAXJ named: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Dec 25 10:59:53 XAXJ named: dns_master_load: com.xaxj.db:9: xaxj.com: not at top of zone
Dec 25 10:59:53 XAXJ named: zone 1.168.192.in-addr.arpa/IN: loading master file com.xaxj.db: not at top of zone
Dec 25 10:59:53 XAXJ named: zone xaxj.com/IN: loaded serial 42
Dec 25 10:59:53 XAXJ named: zone localhost/IN: loaded serial 42
Dec 25 10:59:53 XAXJ named: running
页: [1]
查看完整版本: 关于Linux 的反向解析问题,困扰我好久了!!!!