Taking Back Control from systemd Networking
Systemd is a software suite that is common in many Linux distributions. Although useful, Systemd is hard to configure and is too bloated. With Systemd, the current networking configuration of the computer becomes much less transparent and manageable, and this is not ideal when managing a networked server. This guide therefore describes how to disable some Systemd services, specifically for Ubuntu Server 18.04.
First, we can revert the networking service to the original Debian
/etc/network/interfaces style of configuring the network:
sudo apt-get update sudo apt-get install ifupdown
/etc/network/interfaces using the handy Debian guide. Next, we disable the networkd services.
systemctl stop systemd-networkd.socket systemd-networkd \ networkd-dispatcher systemd-networkd-wait-online systemctl disable systemd-networkd.socket systemd-networkd \ networkd-dispatcher systemd-networkd-wait-online
We can also remove netplan, as it is no longer used.
sudo apt -y purge netplan.io
Systemd also has a DNS resolver, but we can disable that:
sudo systemctl disable systemd-resolved.service sudo systemctl stop systemd-resolved
Delete the symlink
/etc/resolv.conf, so that we can edit it.
sudo rm /etc/resolv.conf
Create a new resolv.conf file, and input the DNS Server that you would like to use.
sudo nano /etc/resolv.conf
For example, my file contains:
Note that the
/etc/resolv.conf file will not be automatically updated by your DHCP client unless you delete the following file:
sudo rm /etc/dhcp/dhclient-enter-hooks.d/resolved