I'd like to run a DNS server for studying purposes but I keep getting this error message. Could you help? (virtual machine in virtualbox: eth0 - NAT, eth1 - internal adapter)
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
The file /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
List of edited files (following the teacher's instructions): /etc/bind/named.conf.local, /etc/bind/db.tanulas, /etc/bind/db.2.0.192, /etc/resolv.conf
By the way /etc/resolv.conf is always overwritten with my host's machine nameservers after every reboot. Why? It should contain
search tanulas.hu
nameserver 192.0.2.5
but it does not.
# Generated by NetworkManager
nameserver 84.2.46.1
nameserver 84.2.44.1
Here is a query on the DNS server.
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 for debianserver ends up with connection timed out.
If it counts, udhcpd works properly.
Thanks