[Solved] Missing /etc/systemd/resolved.conf file
from Tywele@lemmy.dbzer0.com to selfhosted@lemmy.world on 15 Sep 2024 17:40
https://lemmy.dbzer0.com/post/27853866

Solution: I just had to create the file

I wanted to install Pi-Hole on my server and noticed that port 53 is already in use by something.

Apparently it is in use by systemd-resolved:

~$ sudo lsof -i -P -n | grep LISTEN
[...]
systemd-r    799 systemd-resolve   18u  IPv4   7018      0t0  TCP 127.0.0.53:53 (LISTEN)
systemd-r    799 systemd-resolve   20u  IPv4   7020      0t0  TCP 127.0.0.54:53 (LISTEN)
[...]

And the solution should be to edit /etc/systemd/resolved.conf by changing #DNSStubListener=yes to DNSStubListener=no according to this post I found. But the /etc/systemd/resolved.conf doesn’t exist on my server.

I’ve tried sudo dnf install /etc/systemd/resolved.conf which did nothing other than telling me that systemd-resolved is already installed of course. Rebooting also didn’t work. I don’t know what else I could try.

I’m running Fedora Server.

Is there another way to stop systemd-resolved from listening on port 53? If not how do I fix my missing .conf file?

#selfhosted

threaded - newest

just_another_person@lemmy.world on 15 Sep 2024 17:46 next collapse

The service is using the default config, which you can override by creating this file.

View the package contents to find out where the default config is located.

abff08f4813c@j4vcdedmiokf56h3ho4t62mlku.srv.us on 18 Sep 16:00 collapse

Yep, it might be enough to just add that file with the setting set to no and restart.

dohpaz42@lemmy.world on 15 Sep 2024 17:59 next collapse

Here is a good primer on the configuration files and their possible locations: www.freedesktop.org/…/resolved.conf.html

Edit: be careful because this is your domain name lookup you’re messing with. 😊

possiblylinux127@lemmy.zip on 15 Sep 2024 21:17 collapse

The domain name shouldn’t matter

dohpaz42@lemmy.world on 16 Sep 01:28 collapse

FWIW, I’m referring to the local DNS (domain name system) resolver; the mechanism that resolves local domain names into IP addresses so that computers can talk to each other over the LAN.

possiblylinux127@lemmy.zip on 16 Sep 02:33 collapse

I know

It still won’t really matter. The domain name is arbitrary in this case

[deleted] on 15 Sep 2024 18:14 next collapse

.

BCsven@lemmy.ca on 15 Sep 2024 18:30 next collapse

When I installed it it suggested turning that service off onvthe host. If you search online there are many suggestions on shutting off that stuff so 53 is left for pihole

possiblylinux127@lemmy.zip on 15 Sep 2024 21:16 next collapse

Um, dnf doesn’t do anything with configuration files. It is used for packages.

I would start by trying to create that file. If that doesn’t fix it after restarting the service look into the docs. You may need to configure network manager.

Tywele@lemmy.dbzer0.com on 16 Sep 06:33 collapse

It tries to install the associated package when given a path to a configuration file.

InvertedParallax@lemm.ee on 16 Sep 19:24 collapse

They probably moved it to somewhere under /usr or /var/lib.

bizdelnick@lemmy.ml on 16 Sep 11:15 next collapse

Disable systemd-resolved.service? Uninstall systemd-resolved?

abff08f4813c@j4vcdedmiokf56h3ho4t62mlku.srv.us on 18 Sep 16:00 collapse

As a temporary fix, instead of service systemd-resolved restart as per the article, you can try this, service systemd-resolved stop

Once the service is stopped the port should be free. You'll have to do this on every reboot (though maybe you can try adding the command to /etc/rc.local to stop it on every reboot)