Output looks ok.
After the reboot
- any errors or interesting messages in
/var/log/pihole-FTL.log
? - run
sudo netstat -tulpen | grep "pihole\|dhcp\|lighttpd"
and post it here.
Output looks ok.
After the reboot
/var/log/pihole-FTL.log
?sudo netstat -tulpen | grep "pihole\|dhcp\|lighttpd"
and post it here.Only thing that looks sus to me is:
ERROR compiling regex on line 1: Invalid preceding regular expression (13)
And the outout from netstat before restarting DNS
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 21063 928/lighttpd
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 999 21580 1047/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 999 21591 1047/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 0 21064 928/lighttpd
tcp6 0 0 fe80::e852:c420:4de::53 :::* LISTEN 999 21912 1047/pihole-FTL
tcp6 0 0 ::1:53 :::* LISTEN 999 21582 1047/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 999 21593 1047/pihole-FTL
udp 0 0 127.0.0.1:53 0.0.0.0:* 999 21579 1047/pihole-FTL
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 21376 975/dhcpcd
udp6 0 0 fe80::e852:c420:4de::53 :::* 999 21911 1047/pihole-FTL
udp6 0 0 ::1:53 :::* 999 21581 1047/pihole-FTL
And after restarting DNS
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 21063 928/lighttpd
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 999 23766 1425/pihole-FTL
tcp 0 0 192.168.0.15:53 0.0.0.0:* LISTEN 999 23764 1425/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 999 23784 1425/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 0 21064 928/lighttpd
tcp6 0 0 ::1:53 :::* LISTEN 999 23770 1425/pihole-FTL
tcp6 0 0 fe80::e852:c420:4de::53 :::* LISTEN 999 23768 1425/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 999 23786 1425/pihole-FTL
udp 0 0 0.0.0.0:65358 0.0.0.0:* 999 24138 1425/pihole-FTL
udp 0 0 127.0.0.1:53 0.0.0.0:* 999 23765 1425/pihole-FTL
udp 0 0 192.168.0.15:53 0.0.0.0:* 999 23763 1425/pihole-FTL
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 21376 975/dhcpcd
udp 0 0 0.0.0.0:7765 0.0.0.0:* 999 24151 1425/pihole-FTL
udp 0 0 0.0.0.0:65125 0.0.0.0:* 999 24135 1425/pihole-FTL
udp 0 0 0.0.0.0:24197 0.0.0.0:* 999 24142 1425/pihole-FTL
udp6 0 0 ::1:53 :::* 999 23769 1425/pihole-FTL
udp6 0 0 fe80::e852:c420:4de::53 :::* 999 23767 1425/pihole-FTL
Mod Edit: formatted output
Try editing these lines in /etc/init.d/pihole-FTL
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
and replace them with these lines:
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
And then reboot your device.
For a (silly) temporary fix, you could add
@reboot sleep 1m && pihole restartdns
To your crontab.
Disclaimer: this is just to automate the restartdns on boot and will not fix the root of your problem.
If @Mcat12 method dont work, below Ubuntu user had something similar.
Solution in that thread is more like a patch and not really a fix.
If have similar issue, you need to figure out why the interface comes up late (dmesg
etc).
And your netstat
looks a bit fragmented.
Below how a clean netstat
could look like:
pi@noads:~ $ sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471[1-8] '
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 2957/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 2957/pihole-FTL
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 579/lighttpd
tcp6 0 0 :::53 :::* LISTEN 2957/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 2957/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 579/lighttpd
udp 0 0 0.0.0.0:53 0.0.0.0:* 2957/pihole-FTL
udp 0 0 0.0.0.0:67 0.0.0.0:* 2957/pihole-FTL
udp6 0 0 :::53 :::* 2957/pihole-FTL
Check for alien config files not belonging to Pi-hole with below one:
sudo grep -v '^#\|^$' -R /etc/dnsmasq.* | sort
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
Didn't work
#!/bin/bash
### BEGIN INIT INFO
# Provides: pihole-FTL
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: pihole-FTL daemon
# Description: Enable service provided by pihole-FTL daemon
### END INIT INFO
sleep 30
FTLUSER=pihole
PIDFILE=/var/run/pihole-FTL.pid
[..]
That worked! Changed it to 20 seconds though
Note that this change will be overwritten by any future updates.
No worries, I'll keep an eye on it after updating. Thanks for your help!
One last thing, the output of
sudo grep -v '^#\|^$' -R /etc/dnsmasq.* | sort
/etc/dnsmasq.conf:conf-dir=/etc/dnsmasq.d
/etc/dnsmasq.conf.old:conf-dir=/etc/dnsmasq.d
/etc/dnsmasq.d/01-pihole.conf~:addn-hosts=/etc/pihole/black.list
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/black.list
/etc/dnsmasq.d/01-pihole.conf~:addn-hosts=/etc/pihole/gravity.list
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/gravity.list
/etc/dnsmasq.d/01-pihole.conf~:addn-hosts=/etc/pihole/local.list
/etc/dnsmasq.d/01-pihole.conf:addn-hosts=/etc/pihole/local.list
/etc/dnsmasq.d/01-pihole.conf~:bogus-priv
/etc/dnsmasq.d/01-pihole.conf:bogus-priv
/etc/dnsmasq.d/01-pihole.conf~:cache-size=10000
/etc/dnsmasq.d/01-pihole.conf:cache-size=10000
/etc/dnsmasq.d/01-pihole.conf~:dhcp-ignore-names=tag:wpad-ignore
/etc/dnsmasq.d/01-pihole.conf:dhcp-ignore-names=tag:wpad-ignore
/etc/dnsmasq.d/01-pihole.conf~:dhcp-name-match=set:wpad-ignore,wpad
/etc/dnsmasq.d/01-pihole.conf:dhcp-name-match=set:wpad-ignore,wpad
/etc/dnsmasq.d/01-pihole.conf~:domain-needed
/etc/dnsmasq.d/01-pihole.conf:domain-needed
/etc/dnsmasq.d/01-pihole.conf:interface=enp0s4
/etc/dnsmasq.d/01-pihole.conf~:localise-queries
/etc/dnsmasq.d/01-pihole.conf:localise-queries
/etc/dnsmasq.d/01-pihole.conf~:local-ttl=2
/etc/dnsmasq.d/01-pihole.conf:local-ttl=2
/etc/dnsmasq.d/01-pihole.conf~:log-async
/etc/dnsmasq.d/01-pihole.conf:log-async
/etc/dnsmasq.d/01-pihole.conf~:log-facility=/var/log/pihole.log
/etc/dnsmasq.d/01-pihole.conf:log-facility=/var/log/pihole.log
/etc/dnsmasq.d/01-pihole.conf~:log-queries
/etc/dnsmasq.d/01-pihole.conf:log-queries
/etc/dnsmasq.d/01-pihole.conf~:no-resolv
/etc/dnsmasq.d/01-pihole.conf:no-resolv
/etc/dnsmasq.d/01-pihole.conf~:server=156.154.70.1#53
/etc/dnsmasq.d/01-pihole.conf:server=156.154.70.1#53
/etc/dnsmasq.d/01-pihole.conf~:server=8.8.8.8#53
/etc/dnsmasq.d/01-pihole.conf:server=8.8.8.8#53
/etc/dnsmasq.d-available/lxd:bind-interfaces
/etc/dnsmasq.d-available/lxd:except-interface=lxdbr0
/etc/dnsmasq.d/lxd:bind-interfaces
/etc/dnsmasq.d/lxd:except-interface=lxdbr0
Id there anything there that shouldn't be?
And thanks for all your help guys it was driving me crazy!
Yes.
The config file /etc/dnsmasq.d/lxd
is not a Pi-hole one.
Try move it out of that folder to your home folder (for backup):
sudo mv /etc/dnsmasq.d/lxd ~
Restart pihole-FTL:
sudo service pihole-FTL restart
And check again:
sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471[1-8] '
Yeah dude I was logged into the wrong linux box when I posted that, I've now edited it sorry about that
netstat
clean now ?
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 882/lighttpd
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1973/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 1973/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 882/lighttpd
tcp6 0 0 :::53 :::* LISTEN 1973/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 1973/pihole-FTL
udp 0 0 0.0.0.0:53 0.0.0.0:* 1973/pihole-FTL
udp6 0 0 :::53 :::* 1973/pihole-FTL
Looks better to me
It sure does
Thanks again dude, ya worth more money!
I have one further question for fixing it in upcoming releases if you don't mind: When you again remove the sleep 20
in your init script (so that the command fails), what is the output in /var/log/pihole.log
?
No dramas
I removed the sleep 20
from /etc/init.d/pihole-FTL
and rebooted
System came back up with everything working. Strange so I rebooted again same thing, everythings working.
Changed this
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
Back to this
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
And it still came up working. So I then moved lxd
back to /etc/dnsmasq.d
and rebooted, it failed! So that was the problem all along.
I did a clean install of Ubuntu 18.04 Server as a VM and setup PiHole in that, I don't remember doing anything with DNS during that install so it might be a default thing I'm not sure.
Anyway, its now working and I now know it was this lxd symlink that was causing the problem all along and nothing to do with PiHole.
And if you hadn't asked me for the output of /var/log/pihole.log
and I'd looked into this more we might never have gotten to the true cause of the problem.
I take it you don't need to see the output of /var/log/pihole.log
anymore?
Great detective work.
I was to type up something similar to warn @DL6ER about the bind-interfaces
directive in that lxd
file.
If pihole-FTL
tries to bind to the IP's assigned to the interfaces, it might run into troubles if an interface comes up late.
With pihole-FTL
listening on all IP's 0.0.0.0
, interfaces (with IP) can come and go without issues.
EDIT: I didnt think about this at the time
Instead of bind-interfaces
, bind-dynamic
would work better.
Enable a network mode which is a hybrid between --bind-interfaces and the default. Dnsmasq binds the address of individual interfaces, allowing multiple dnsmasq instances, but if new interfaces or addresses appear, it automatically listens on those (subject to any access-control configuration). This makes dynamically created interfaces work in the same way as the default. Implementing this option requires non-standard networking APIs and it is only available under Linux. On other platforms it falls-back to --bind-interfaces mode.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.