Pi-Hole no longer uses the dnsmasq DNS proxy directly. However, existing installations will still have it installed and the service will still attempt to run and fail (as it should).
I was keen to get rid of it as I’m not a fan of unused services especially ones that should always fail. It was not as straightforward as I’d hoped as it is an init.d service. After a discussion on the forum, and some trial and error I think this is what I did. Unfortunately, I could not go back to where I was before I started so I cannot be 100% confident it is right (or the order).
So the issue was that, as this is a service that is started via update-rc.d a normal ‘disable’ does not work as it leaves the various run level files hanging around as seen by
1 |
ls -l /etc/rc?.d/*dns* |
To remove those you need to execute
1 |
update-rc.d -f dnsmasq remove |
Secondly, disabling a service simply stops it from running at boot, but does leave open the possibility of it being initiated by another service. To stop the possibility of that happening, a
1 |
systemctl mask dnsmasq.service |
is required.
This then removes it from the output of a systemctl status and avoids confusion.
There is a suggestion that dnsmasq could be uninstalled. I decided not to as it felt a little risky (I may take a VM snapshot and try).
To ‘uninstall’ a package, you need to do one of 4 things with apt.
remove– just removes the package from the os (i.e. uninstalls it) and not from the disk (the cached package).
purge – removes the installed package and associated files like personal settings, configuration files etc
auto-remove – removes any packages that are no longer required as a result of removing packages that had previously caused other dependencies to be installed. If used with purge will remove associated files as well.
clean – actually removes all of the above from disk, think emptying a recycle bin in windows.
by