我对 DNS 服务器完全陌生,作为一个教育工具,我在运行 Dietpi 的 RPi 上安装了 bind9 - 一个精简版的 Debian。
外部地址可以完美解析,但内部地址不能。我有一个这样设置的 db.local.lan 文件:
$TTL 3D
$ORIGIN local.lan.
local.lan. IN SOA dietpi.local.lan. hostmaster.local.lan. (
2020100418 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
local.lan. IN NS dietpi.local.lan.
local.lan. IN MX 10 dietpi.local.lan.
localhost IN A 127.0.0.1
dietpi IN A 192.168.20.254
router IN A 192.168.20.1
NL1901ACV IN A 192.168.20.1
named.conf.local 是这样的:
//
// Do any local configuration here
//
zone "local.lan" IN {
type master;
file "/etc/bind/db.local.lan";
};
zone "20.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.20.168.192.in-addr.arpa";
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
我有一台电脑设置为使用这个设备作为它的 dns 服务器。从这台电脑我可以ping google.com,但如果我尝试pingdietpi 或dietpi.local.lan,我会收到找不到主机的错误。
named-checkconf 没有显示任何错误。
named-checkconf -z 返回以下内容 - 我不知道这意味着什么!
/etc/bind/db.local.lan:10: unknown RR type 'local.lan.'
/etc/bind/db.local.lan:11: unknown RR type 'local.lan.'
/etc/bind/db.local.lan:12: unknown RR type 'localhost'
/etc/bind/db.local.lan:13: unknown RR type 'dietpi'
/etc/bind/db.local.lan:14: unknown RR type 'router'
/etc/bind/db.local.lan:15: unknown RR type 'NL1901ACV'
zone local.lan/IN: loading from master file /etc/bind/db.local.lan failed: unknown class/type
zone local.lan/IN: not loaded due to errors.
_default/local.lan/IN: unknown class/type
/etc/bind/db.rev.20.168.192.in-addr.arpa:1: no TTL specified; using SOA MINTTL instead
/etc/bind/db.rev.20.168.192.in-addr.arpa:10: TTL set to prior TTL (1)
zone 20.168.192.in-addr.arpa/IN: loaded serial 2020100417
zone localhost/IN: loaded serial 2
zone 127.in-addr.arpa/IN: loaded serial 1
zone 0.in-addr.arpa/IN: loaded serial 1
zone 255.in-addr.arpa/IN: loaded serial 1
谁能解释我做错了什么?
提前致谢。大卫。