How to enable and disable systemd-resolved in Ubuntu

This guide will show you how to enable and disable the systemd-resolved service in Ubuntu.

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.

Pi-hole is an advertisement blocking application that acts as a DNS. It also blocks Internet trackers. Click here to learn more.

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

You may also be interested in

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.