Hi all, I need a little help to solve the problem.
I installed pi-hole with docker on a pi4 with Ubuntu server 22.04.
I have a problem, pi-hole tells me: DNSMASQ_CONFIG FTL failed to start due to failed to create listening socket for port 53 : Address already in use.
When I do ss -tulpn | grep 53, I get :
udp UNCONN 0 0 127.0.0.53%lo:53
tcp LISTEN 0 4096 127.0.0.53%lo:53
I don't know how to stop or change the port used by the raspberry.
Do you have any idea? I'm a bit new to Linux without a GUI.
Please follow our help template. In particular, we need your debug log.
Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:
You are running your Pi-hole in a Docker container, so your debug log would not contain which actual process is listening on port 53.
But as you are running Ubuntu, it is likely that that process would be systemd-resolved stub resolver.
You should be able to confirm by running the following command on your host machine:
sudo ss -tulpn sport = 53
In any case, you'd have to disable the process that binds port 53, to free that port for usage by Pi-hole.
Alternatively, you may be able to point the stub resolver to make use of Pi-hole as its upstream, by pointing it to to private IP of your host machine.
According to your debug log, that would be 192.168.1.3.
That may also require your Pi-hole container to map port 53 UDP/TCP specifically for that IP address, in order to avoid the localhost port conflict. This would preclude you from running your Pi-hole container in Docker's host network mode, as you can't map ports in that mode.
I've modified /etc/systemd/resolved.conf and enabled the systemd-resolved service. In /etc/systmed/resolved I added the box as DNS, so port 53 is no longer used by systemd.
However, in /etc/resolv.conf it's still 127.0.0.53 and in systemd/resolved.conf it's 192.168.1.1.
How can I configure DNS from the command line on a fresh Ubuntu 22.04 and be sure that it won't change after a reboot ?
Does that mean that you've enabled systemd-resolved now in addition to whatever has already been listening on port 53 before?
My advice was to disable the process that binds port 53.
I then added DNS = 192.168.1.1 to /etc/systemd/resolved.conf. Then I restarted the service, systemctl restart systemd-resolved.
After a restart, the /etc/resolv.conf file still has nameserver 127.0.0.53, whereas the file in /etc/systemd/resolv.conf has DNS 192.168.1.1. At this point, I'm back to where I started (port 53 is taken by users: "systemd-resolve",pid=24434,fd=14).
I can't see any difference between the Desktop and Server versions, apart from the GUI and a few packages. I'll have a look at the links you gave me, otherwise I'm a bit stuck.
Hello @Bucking_Horn,
It's ok now, it works like a charm.
For now I'm using the resolvconf tool and the pi-hole container can use port 53.
Thank you very much for your help and answers