Network manager breaks pi-hole

The issue I am facing:
DNS service not running and FTL offline

Details about my system:
Pi3B+ Raspbian Buster (10)

What I have changed since installing Pi-hole:
I need to make network manager working for EAP wifi to be working properly.
After installing network manager, the only way for it to work is to sudo apt purge dhcpcd5.
I believe though that pi-hole can't work without it. Is there any other way?

Everything should work fine. You may break Raspbian by purging dhcpcd since that's how the entire OS is designed to handle networking, but all Pi-hole needs is a static IP address.

Hmm, I don't believe it is ok. If I try to repair my pihole, it reinstalls dhcpcd :confused: therefore it breaks the networkmanager again.

And then pihole still says DNS service not running and FTL offline

This should be fixed in Pi-hole @DanSchaper maybe you can recognize the user intentionally uninstalled dhcpcd ? Maybe add a setting to setupVars.conf (DONT_INSTALL_DHCPCD).

These may be false positives. Try

sudo service pihole-FTL status

and

dig google.com @127.0.0.1

on your Pi-hole and see if especially the second command returns a valid response.

I guess you may be right.

pi@raspberrypi:~ $ sudo service pihole-FTL status
â—Ź pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Mon 2020-07-20 01:09:36 CEST; 7h ago
Docs: man:systemd-sysv-generator(8)
Process: 1802 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SU

Jul 20 01:09:35 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Jul 20 01:09:35 raspberrypi pihole-FTL[1802]: Not running
Jul 20 01:09:35 raspberrypi su[1826]: (to pihole) root on none
Jul 20 01:09:35 raspberrypi su[1826]: pam_unix(su:session): session opened for u
Jul 20 01:09:36 raspberrypi pihole-FTL[1802]: dnsmasq: failed to create listenin
Jul 20 01:09:36 raspberrypi su[1826]: pam_unix(su:session): session closed for u
Jul 20 01:09:36 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

pi@raspberrypi:~ $ dig google.com@127.0.0.1

; <<>> DiG 9.11.5-P4-5.1+deb10u1-Raspbian <<>> google.com@127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27670
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com@127.0.0.1. IN A

;; AUTHORITY SECTION:
. 1301 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2020072000 1800 900 604800 86400

;; Query time: 69 msec
;; SERVER: 195.238.2.21#53(195.238.2.21)
;; WHEN: Mon Jul 20 08:37:15 CEST 2020
;; MSG SIZE rcvd: 124

However, I also got to say that the graphics/graphs are not displaying anything.

1 Like

This is the problem, please check /var/log/pihole.log for the not truncated error message!

To get that output, use:

sudo systemctl status --full --no-pager status pihole-FTL.service

And to prevent dhcpcd5 from getting installed so NM can take over:

Here it is:

pi@raspberrypi:~ $ sudo systemctl status --full --no-pager status pihole-FTL.service
Unit status.service could not be found.
â—Ź pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Mon 2020-07-20 01:09:36 CEST; 22h ago
Docs: man:systemd-sysv-generator(8)
Process: 1802 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Jul 20 01:09:35 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Jul 20 01:09:35 raspberrypi pihole-FTL[1802]: Not running
Jul 20 01:09:35 raspberrypi su[1826]: (to pihole) root on none
Jul 20 01:09:35 raspberrypi su[1826]: pam_unix(su:session): session opened for user pihole by (uid=0)
Jul 20 01:09:36 raspberrypi pihole-FTL[1802]: dnsmasq: failed to create listening socket for port 53: Address already in use
Jul 20 01:09:36 raspberrypi su[1826]: pam_unix(su:session): session closed for user pihole
Jul 20 01:09:36 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

Oh cool, thank you for this!

So this changes :

Candidate: 1:8.1.2-1+rpt1

to

Candidate: (none)

And now I have to reinstall pihole? Or repair it?

Probably NM runs its own DNS forwarding service for caching.
Which one ?

sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:547 \|:471[1-8] '

Purge dhcpcd5 again if want to have NM take over.
But you have to configure a static IP through NM.

EDIT: and probably best to run pihole -r and select reconfigure when all finished/up/running.

The below:

pi@raspberrypi:~ $ sudo netstat -nltup | grep 'Proto|:53 |:67 |:80 |:547 |:471[1-8] '
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 1230/lighttpd
tcp 0 0 192.168.0.39:53 0.0.0.0:* LISTEN 596/dnsmasq
tcp6 0 0 :::80 :::* LISTEN 1230/lighttpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 596/dnsmasq
udp 0 0 192.168.0.39:53 0.0.0.0:* 596/dnsmasq

Above is the one conflicting preventing pihole-FTL to bind to socket.
Dont need the dnsmasq binary as dnsmasq is already embedded into Pi-hole's own binary pihole-FTL.
You can purge dnsmasq.

It was already purged and NM has taken indeed over.
And Under IPv4 Settings, under Address (optional) I have placed the Pi's IP/Subnet mask and the gateway of the router. :wink:

Question: I want to bridge this from Wifi to ethernet. Wifi connects fine and I wanna bridge my lan and give the wifi's internet connected to lan to a router. The address stays the internal to the internal network. However the gateway, should now be the IP address of Pi?

Stupid question: Will piVPN play nicely if I do so?

Interestingly, dnsmasq is not installed:

pi@raspberrypi:~ $ sudo netstat -nltup | grep 'Proto|:53 |:67 |:80 |:547 |:471[1-8] '
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 1230/lighttpd
tcp 0 0 192.168.0.39:53 0.0.0.0:* LISTEN 596/dnsmasq
tcp6 0 0 :::80 :::* LISTEN 1230/lighttpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 596/dnsmasq
udp 0 0 192.168.0.39:53 0.0.0.0:* 596/dnsmasq
pi@raspberrypi:~ $ sudo apt-get purge dnsmasq
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'dnsmasq' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

Bridge pointers below:

I believe folks have gotten piVPN to work with Pi-hole.
Search Discourse here.

1 Like

I tried to purge dnsmasq and it was not installed.

Also:

pi@raspberrypi:~ $ apt policy dnsmasq
dnsmasq:
Installed: (none)
Candidate: 2.80-1+rpt1
Version table:
2.81-4 -1
-1 Index of /raspbian bullseye/main armhf Packages
2.80-1+rpt1 500
500 Index of /debian buster/main armhf Packages
2.80-1 500
500 Index of /raspbian buster/main armhf Packages

Must have come with NM.
Search the net how to disable dnsmasq in combination with NM for your distro.