Existing DNSMASQ + Pi-Hole


#1

Expected Behaviour:

Use existing installed DNSMASQ together with pi-hole FTL without interuptions

Actual Behaviour:

DNS service is not started during installation

Debug Token: ersoo8bxnd

Hi, I’m using my PI as DNS and DHCP server with DNSMASQ, I tried to install pi-hole but it could not start dns service.
Then I learned that it’s using own FTL dns. Is there any way to install pi-hole without interupting existing dns / dhcp?


#2

Pi-hole FTL contains a full working version of DNSmasq so also running version of DNSmasq will conflict.

Suggestion, remove or disable DNSmasq.


#3

Pi-Hole will perform both of these functions. Your existing dnsmasq configuration files can still be used.

You will need to stop dnsmasq so pihole-FTL can listen on port 53. Then Pi-Hole will work properly. From your debug log, dnsmasq is on port 53.

*** [ DIAGNOSING ]: Ports in use
*:5900 vncserver- (IPv6)
*:5900 vncserver- (IPv4)
*:22 sshd (IPv4)
*:22 sshd (IPv6)
*:80 lighttpd (IPv4)
*:80 lighttpd (IPv6)
*:53 dnsmasq (IPv4)
*:53 dnsmasq (IPv6)

*** [ DIAGNOSING ]: Pi-hole processes
[✓] dnsmasq daemon is active
[✓] lighttpd daemon is active
[✗] pihole-FTL daemon is inactive

#4

@jfb Thanks for the tip, could please tell me at which point I need to stop dnsmasq?
Because I get no DNS if I disable it before installation and installation needs dns.

And it during the installation it says:
Stopping DNS service
Starting DNS service -> but this finishes with timeout and DNS service is never started (when I ran install script as user)

Then I ran installation as root, it went through but FTL does not work correctly and when I enter web admin page all graphs are just loading but does not show anything.

here is the log

Oct 09 06:24:07 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Oct 09 06:24:07 raspberrypi pihole-FTL[10586]: Not running
Oct 09 06:24:07 raspberrypi pihole-FTL[10586]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
Oct 09 06:24:07 raspberrypi su[10613]: Successful su for pihole by root
Oct 09 06:24:07 raspberrypi su[10613]: + ??? root:pihole
Oct 09 06:24:07 raspberrypi su[10613]: pam_unix(su:session): session opened for user pihole by (uid=0)
Oct 09 06:24:08 raspberrypi pihole-FTL[10586]: dnsmasq: cannot open or create lease file /var/lib/misc/dnsmasq.leases: Permission denied
Oct 09 06:24:08 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.
Oct 09 06:27:00 raspberrypi systemd[1]: Stopping LSB: pihole-FTL daemon...
Oct 09 06:27:00 raspberrypi pihole-FTL[10965]: Not running
Oct 09 06:27:00 raspberrypi systemd[1]: Stopped LSB: pihole-FTL daemon.
Oct 09 06:33:49 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Oct 09 06:33:49 raspberrypi pihole-FTL[11876]: Not running
Oct 09 06:33:49 raspberrypi pihole-FTL[11876]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
Oct 09 06:33:49 raspberrypi su[11901]: Successful su for pihole by root
Oct 09 06:33:49 raspberrypi su[11901]: + ??? root:pihole
Oct 09 06:33:49 raspberrypi su[11901]: pam_unix(su:session): session opened for user pihole by (uid=0)
Oct 09 06:33:52 raspberrypi pihole-FTL[11876]: dnsmasq: cannot open or create lease file /var/lib/misc/dnsmasq.leases: Permission denied
Oct 09 06:33:52 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

#5

The famous chicken and the edge problem but this time it should workout.

If you are already on Pi-hole FTL and you are according to, then you can just type on the prompt:

systemctl stop dnsmasq
systemd disable dnsmasq

Then type:

systemctl restart pihole-FTL


#6

I tried already but it did not work and I got no DNS resolution, there must be some config file or something missing.


#7

Please check if the content of the /etc/dnsmasq.conf only contains: conf-dir=/etc/dnsmasq.d

If not make first a copy of dnsmasq.conf and save it. Then make that line the only one that file and save it.

Restart Pi-hole and if that does not work run pihole -r

If you get that there is no DNS resolution and there is not as you wrote change the file /etc/resolv.conf from nameserver 127.0.0.1 to nameserver 8.8.8.8 and save that. The line will be reverted by Pi-hole once it works.


#8

You will likely need root user privileges to stop dnsmasq:

sudo service dnsmasq stop
sudo service dnsmasq disable
sudo service pihole-FTL restart

This command will completely remove dnsmasq from your system (except for the one included in FTL):

sudo apt-get remove dnsmasq