This guide will show you how to enable and disable the systemd-resolved service in Ubuntu.
Table of Contents
What is systemd-resolved?
systemd-resolved is a systemd service that provides network name resolution to local applications. Additionally, systemd-resolved is installed by default as part of the systemd package.
systemd-resolved provides the following resolver services:
- Domain Name System (DNS, DNSSEC and DNS over TLS)
- Multicast DNS
- Link-Local Multicast Name Resolution
Why would you disable it?
You may want to disable systemd-resolved so that you can use another resolver on the same host. For example, you must do this before installing PiHole as the alternative DNS server.
You need to disable one DNS service since you cannot have two services listening on the same port.
Changes as of Ubuntu 18.04
Netplan is now the default network management tool as of Ubuntu 18.04. Netplan replaces the /etc/resolv.conf and /etc/network/interfaces configuration files used to configure the network.
How to disable systemd-resolved in Ubuntu
Run the following commands to disable and stop the systemd-resolved service:
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
How to enable systemd-resolved in Ubuntu
Run the following commands to enable and start the systemd-resolved service:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service