我想运行 DNS 服务器用于学习目的,但我不断收到此错误消息。你能帮忙吗? (virtualbox 中的虚拟机:eth0 - NAT,eth1 - 内部适配器)
debianserver@debianserver:~$ sudo /etc/init.d/bind9 restart
[ ok ] Restarting bind9 (via systemctl): bind9.service.
debianserver@debianserver:~$ sudo tail /var/log/syslog
Aug 28 09:48:25 debianserver named[1787]: zone 0.in-addr.arpa/IN: loaded serial 1
Aug 28 09:48:25 debianserver named[1787]: dns_rdata_fromtext: /etc/bind/db.tanulas:17: near eol: unexpected end of input
Aug 28 09:48:25 debianserver named[1787]: zone tanulas.hu/IN: loading from master file /etc/bind/db.tanulas failed: unexpected end of input
Aug 28 09:48:25 debianserver named[1787]: zone tanulas.hu/IN: not loaded due to errors.
Aug 28 09:48:25 debianserver named[1787]: zone 2.0.192.in-addr.arpa/IN: loaded serial 2016101001
Aug 28 09:48:25 debianserver named[1787]: zone 255.in-addr.arpa/IN: loaded serial 1
Aug 28 09:48:25 debianserver named[1787]: zone 127.in-addr.arpa/IN: loaded serial 1
Aug 28 09:48:25 debianserver named[1787]: zone localhost/IN: loaded serial 2
Aug 28 09:48:25 debianserver named[1787]: all zones loaded
Aug 28 09:48:25 debianserver named[1787]: running
文件/etc/bind/db.tanulas
:
$TTL 86400
@ IN SOA debianserver.tanulas.hu. root.debianserver.tanulas.hu. (
201610141 ;Serial
28800 ;Refresh
7200 ;Retry
604800 ;Expire
86400 ) ;Negativ cache TTL
@ IN NS debianserver.tanulas.hu.
debianserver IN A 192.0.2.5
@ IN MX 10 debianserver.tanulas.hu.
ns IN CNAME debianserver.tanulas.hu.
www IN CNAME debianserver.tanulas.hu.
ftp IN CNAME debianserver.tanulas.hu.
mail IN CNAME debianserver.tanulas.hu.
ssh IN CNAME debianserver.tanulas.hu.
debianserver IN HINFO Linux/Jessie
win8 IN A 192.0.2.3
已编辑文件列表(按照老师的指示):/etc/bind/named.conf.local
, /etc/bind/db.tanulas
, /etc/bind/db.2.0.192
,/etc/resolv.conf
顺便说一句,/etc/resolv.conf
每次重新启动后总是会被我的主机的机器名称服务器覆盖。为什么?它应该包含
search tanulas.hu
nameserver 192.0.2.5
但事实并非如此。
# Generated by NetworkManager
nameserver 84.2.46.1
nameserver 84.2.44.1
这是对 DNS 服务器的查询。
debianserver@debianserver:~$ dig @localhost tanulas.hu
; <<>> DiG 9.9.5-9+deb8u6-Debian <<>> @localhost tanulas.hu
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 35896
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;tanulas.hu. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Aug 28 14:26:31 CEST 2016
;; MSG SIZE rcvd: 39
nslookup
对于 debianserver 最终连接超时。
如果算数,则udhcpd
可以正常工作。
谢谢
答案1
HINFO 必须有 2 个参数:“CPU/硬件”和“操作系统”。你只有一个。尝试扩展它:
debianserver IN HINFO Linux/Jessie makosteszta