I followed this very nice tutorial to make my first DNS server on Debian Jessie (on my Raspberry Pi). It seems to have worked fine. I can ping:
ping myhostname.mydomain
and it works fine. The problem is that EVERYTIME I restart my raspberry Pi, I have to run
sudo service bind9 restart
or otherwise the DNS server won't start with my configuration and my DNS definitions won't work. Now I have to say that if I run htop
, I can see bind9 running there, but nevertheless, I do ping
and I get that hostname doesn't exist. Only after I restart bind9 manually, the DNS server works again.
I have to say that while I have been trying to fix this, I made bind9 run through Chroot as explained in the Debian page, but this didn't help.
I'm still very new to this, so please ask if you require any additional information. I don't know where to start looking for issues of bind9 to solve this problem.
Note: I started all this from a fresh installation.
Update based on questions from comments:
dig myhostname.mydomain
gives a timeout:
; <<>> DiG 9.9.5-9+deb8u3-Raspbian <<>> myhostname.mydomain
;; global options: +cmd
;; connection timed out; no servers could be reached
The command netstat -plnut
returns
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::53 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:953 :::* LISTEN -
tcp6 0 0 ::1:6010 :::* LISTEN -
udp 0 0 127.0.0.1:53 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 192.168.1.2:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp 0 0 0.0.0.0:48851 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp6 0 0 :::546 :::* -
udp6 0 0 :::53 :::* -
udp6 0 0 2003:75:e15:c201:52:123 :::* -
udp6 0 0 fe80::ba27:ebff:fe7:123 :::* -
udp6 0 0 ::1:123 :::* -
udp6 0 0 :::123 :::* -
udp6 0 0 :::53420 :::* -
udp6 0 0 :::5353 :::* -
After restarting, these two lines get added, which belong to the DNS server:
tcp 0 0 192.168.1.2:53 0.0.0.0:* LISTEN -
udp 0 0 192.168.1.2:53 0.0.0.0:* -