Resolved.conf

Where is this file now as I cannot find it in old location /etc/system/resolved.conf. as I need to edit this line DNSStubListener=no #uncommented to be able to run pihole on port 53

Any help please

I think systemd is no longer pre-creating the files if they contain all default settings (i.e. all the settings are commented out). You can create the file manually. Use man resolved.conf to look up the possible settings and their default values.

BTW, I would recommend creating /etc/systemd/resolved.conf.d/custom.conf instead (the file would have exactly the same contents). That way, you won’t (potentially) end up with a /etc/systemd/resloved.conf.rpmnew file after an update someday (or worse, accidentally overwrite your custom setting with the defaults while running rpmconf).

1 Like

Using drop-in files is nice. In kickstart I have a %post scrip that has

#systemd-resolved enables llmnr, mdns, disable before firstboot
install -o root -g root -m 0755 -d /etc/systemd/resolved.conf.d
install -o root -g root -m 0644 /dev/null /etc/systemd/resolved.conf.d/00-disable-llmnr.conf
cat<<'EOF'>/etc/systemd/resolved.conf.d/00-disable-llmnr-mdns.conf
[Resolve]
LLMNR=false
MulticastDNS=false
EOF
1 Like

Thanks for helping, so if I create the custom file that will be empty would I then add this line DNSStubListener=no #uncommented
then use this command as before sudo systemctl restart systemd-resolved

You will need to define the config section as well on an earlier line ([Resolve]).

I could do this before in versions before 41, but now it seems harder and I cannot follow, all this is new to me

Lots of detail in

man resolved.conf

I’m not sure what the motive is for not pre-creating those example files under /etc/systemd. I guess it is to make it easier to determine at a glance what services might have been customized. If you really need the example file, you can sometimes find a copy under the distribution’s version of that systemd config directory – /usr/lib/systemd. Don’t edit any files there though or else they will be overwritten the next time you update your system. You can copy the examples from under /usr/lib/systemd to /etc/systemd if you need.

where would I find that?

man is a command. It is short for “manual”. Just about every Linux program will come with at least one man page. I occasionally use rpm -ql <package> to discover what man pages and other documentation are distributed with a given program (e.g. rpm -ql systemd-resolved). You can also use rpm -qa to get a listing of all the program packages that are installed on your system.

Press the q key to quit the man program when you are done reading. :slightly_smiling_face:

Thanks this one helped, found a copy of resolved.conf where you said, copy and paste to /etc/systemd edited restarted systemd I was the able to get portainer to setup pihole with no error about port 53, thanks again

1 Like

With the move to using drop-in files there is no need for the example files to be in /etc. You will find the files full file in /usr/lib/systemd/resolv.conf for resolv.conf.

This makes it far easier when updating the system as admin nolonger needs to merge any changes.

1 Like