我知道关于绑定总是有很多答案。 但不知何故,我不明白我的设置的问题。
这是我的configuration
options { listen-on port 53 { 192.168.159.130; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query { any; }; recursion yes; } zone "example.com" IN { type master; file "example.fz"; allow-update { none; }; }; zone "159.168.192.in-addr.arpa" IN { type master; file "example.rz"; allow-update { none; }; };
#/var/named/example.fz文件
$TTL 1D @ IN SOA @ example.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum IN NS ns1.example.com. IN A 192.168.159.130 ns1 IN A 192.168.159.130
#/var/named/example.rz文件
$ TTL 1D @ IN SOA @ rname.invalid。 (0;连续1D;刷新1H;重试1W;到期3H); 最低限度
IN NS ns1.example.com. IN A 192.168.159.130 130 IN PTR ns1.example.com.
#/etc/resolv.conf
search example.com nameserver 192.168.159.130
# 检测结果
[root@localhost named]# named-checkconf /etc/named.conf [root@localhost named]# named-checkzone example.com /var/named/example.fz zone example.com/IN: loaded serial 0 OK [root@localhost named]# named-checkzone example.com /var/named/example.rz zone example.com/IN: NS 'ns1.example.com' has no address records (A or AAAA) zone example.com/IN: not loaded due to errors. nslookup example.com Server: 192.168.159.130 Address: 192.168.159.130#53 ** server can't find example.com.example.com: SERVFAIL
我曾经使用完全相同的设置,据我记得工作得很好,但不是现在! 希望有人能指出一些东西。
注意:我已经重新绑定好几次了。
嗯…..你似乎没有configuration的“提示”区域(即TLD的连接胶水)。
解
最后/var/named/data/named.run文件显示灯。 这实际上是愚蠢的。 我的区域文件正在获取权限问题
PS:如果你是在真正的领域这样做,你应该把适当的TTL和SOA值