我正在创建一个本地网络绑定服务器。
我写了这个配置文件
/etc/bind/named.conf.local
include "/etc/bind/zones.rfc1918";
acl localnet {
192.168.1.0/24;
127.0.0.0/8;
};
zone "example.local" {
type master;
file "/etc/bind/db.example.local";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192.168.1";
};
/etc/bind/db.example.local
$TTL 3600
@ IN SOA ns.example.local. dns01.example.local. (
2007112701; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
;
IN NS ns.example.local
IN MX 10 mail01.example.local
@ IN A 192.168.1.108
dns01 IN A 192.168.1.108
ns IN CNAME dns01
gateway IN A 192.168.1.1
/etc/bind/db.192.168.1
$TTL 3600
@ IN SOA ns.example.local. dns01.example.local. (
2007112702; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
;
IN NS ns.example.local.
200 IN PTR dns01.example.local.
1 IN PTR gateway.example.local.
然后 /etc/init.d/bind9 restart 和 /etc/resolv.conf
domain example.local
nameserver 192.168.1.108
$ nslookup dns01
Server: 192.168.1.108
Address: 192.168.1.108#53
Name: dns01.example.local
Address: 192.168.1.108
$ nslookup dns01
Server: 192.168.1.108
Address: 192.168.1.108#53
Name: dns01.example.local
Address: 192.168.1.108
$ nslookup 192.168.1.108
Server: 192.168.1.108
Address: 192.168.1.108#53
** server can't find 108.1.168.192.in-addr.arpa.: NXDOMAIN [#id7e65d6]
怎么了?
答案1
这是您的完整 /etc/bind/db.192.168.1 吗?因为它不包含 108 的条目。
$TTL 3600
1.168.192.IN-ADDR.ARPA IN SOA ns.example.local. dns01.example.local. (
2007112702; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
IN NS ns.example.local.
$ORIGIN 1.168.192.IN-ADDR.ARPA.
108 IN PTR dns01.example.local.
1 IN PTR gateway.example.local.