how to disable systemd resolved service

the resolved service of systemd can be a blessing for those folks who move around a lot. well, it would be, if it only worked as it should… in my case, i don’t need the overhead, dainbramage, and aggravation, so i disable it.

as always, YMMV, and you’re expected to know how to deal with the required configurations for the lossage that result from these changes. for example, if one does this on their laptop, and switch the network from the home ethernet LAN to their phone’s wifi, they must have another way to update the /etc/resolv.conf file.

disable the service:
systemctl disable systemd-resolved.service
systemctl stop systemd-resolved.service
create a real resolver config:
# substitute the ip of your nameserver(s)
# and, optionally, your preferred search domains
rm /etc/resolv.conf
cat >/etc/resolv.conf <<EOM
nameserver 8.8.8.8
nameserver 8.8.4.4
search grox.net local
EOM
tell NetworkManager about it:
ed -s /etc/NetworkManager/NetworkManager.conf <<EOM
/^.main]
a
dns=default
.
w
q
EOM
systemctl restart network-manager
test

try various tools. be sure to try to connect to the host as well as simply do name and address lookups. the mechanisms vary so e.g., dig and host may return results, but ping fails to find the host.

dig grox.net
unbound-host grox.net
curl https://grox.net/ip
ping grox.net

that’s all folks!
…dave
Mon Feb 19 11:42:26 PST 2018