Algo/Ubuntu starting dnsmasq

Hmmz, after a reboot of my Ubuntu server i got an error:

Jul 25 13:48:22 ip-xxx.xx.xx.xx dnsmasq[23076]: dnsmasq: failed to create listening socket for xxx.xx.xx.xx: Address already in use
Jul 25 13:48:22 ip-xxx.xx.xx.xx dnsmasq[23076]: failed to create listening socket for xxx.xx.xx.xx: Address already in use
Jul 25 13:48:22 ip-xxx.xx.xx.xx dnsmasq[23076]: FAILED to start up
Jul 25 13:48:22 ip-xxx.xx.xx.xx systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
Jul 25 13:48:22 ip-xxx.xx.xx.xx systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

The reason was, dnsmasq.service had started again for some reason...
after running systemctl stop dnsmasq.service and systemctl disable dnsmasq.service and systemctl start pihole-FTL.service eveything works again.

Can't dnsmasq be removed completely?

You can, but I think it's a dependency of network manager and it will be installed again on a system (auto) update.

I posted this info here:

Due to the nature of your environment and the presence of Network Manager, after FTLDNS is installed, you need to make sure that Network Manager does NOT enable dnsmasq (at reboot) before FTLDNS. In order to achieve that, you need to edit

/etc/NetworkManager/NetworkManager.conf

And comment out or delete the line that has dns=dnsmasq.

Then you need to restart NetworkManager in order for the new settings (without dnsmasq as resolver) to be applied:

sudo systemctl reload-or-restart NetworkManager

If after reboot, your /admin/ interface is showing Lost Connection To Api and DNS resolution is not working, then that means that FTLDNS is offline.

Check to see if dnsmasq is running with

sudo systemctl status dnsmasq

It should say

If dnsmasq is active you need to stop it and restart FTLDNS in order for the DNS resolution to work properly.

sudo systemctl stop dnsmasq
sudo systemctl restart pihole-FTL.service

Once you have done this, you need to find out why dnsmasq is starting.

If you don't use dnsmasq in your own setup, it is safe to uninstall it if you so chose to do so.

sudo apt remove dnsmasq however since it's a dependency of Network Manager, it MIGHT be re-installed if your environment is set-up for auto updates and it will break FTLDNS again.

If you did everything right, dnsmasq shouldn't be a problem once on FTLDNS and the disable method above.

Let me know if this doesn't work for you.

thanks for your reply!

I don't have NetworkManager installed/running. It's a headless server.
Something is starting dnsmasq though... (even though i have disabled the dnsmasq service.)

root:~# systemctl --all|grep -i networkman
● NetworkManager.service                                                      not-found inactive dead      NetworkManager.service
root:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
root:/etc/pihole# pihole -v
  Pi-hole version is v3.3.1-136-ga7e7680 (Latest: v3.3.1)
  AdminLTE version is v3.3-130-g4355bde (Latest: v3.3)
  FTL version is vDev-5ecab0a (Latest: v3.0)

That's strange ...
I'm on

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

And I have network manager (i probably installed it a while back and I can't remember though).

You need to find out what executes dnsmasq at boot/reboot.

Meanwhile, try

sudo systemctl disable dnsmasq
sudo systemctl restart pihole-FTL.service

You could (as a last resort)

sudo systemctl mask dnsmasq

That will (for sure) take care of dnsmasq :slight_smile:

Thanks for the tip, that worked! :+1: :smile:

PS.
Perhaps it would be useful adding some info about this issue to the beta post, as more people who install the beta will probably run into this problem..?

Version 4.0 implemented a check for port 53 availability (and a couple of checks for what turns on dnsmasq outside Pi-hole). I would really like to know what starts yours ...

Does

which NetworkManager

output anything ?

no output.

The thing is, i'm running pi-hole on Algo .... so not exactly a default Ubuntu install :blush:

I tried to look around and at first glance without going too deep, I didn't find a place where dnsmasq is started.

If you feel like troubleshooting (and disable FTLDNS, unsmask dnsmasq, restart dnsmasq), could you share the output of:

systemctl status <pidOFdnsmasq> ?

Ah .. You were prompted on install:

Do you want to install a DNS resolver on this VPN server, to block ads while surfing?
[y/N]: " -r dns_enabled

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.