Configuring DNS Resolvers in systemd-resolved

Overview

On systems using systemd-resolved, such as Arch Linux and many of its derivatives like #CachyOS, managing DNS resolves is handled through a simple

Checking current configuration

View the current config with systemd-analyze cat-config systemd/resolved.conf
This will also indicate the location of the configuration on the first line of output.

Configure DNS Resolvers

In my setup, I want to make sure my #homelab DNS servers are preferred, so I make sure the local resolvers are known to my systems.

  1. Open up /etc/systemd/resolved.conf with a text editor
  2. Below the [Resolve] section, add your DNS servers
    1. uncomment DNS= and add a server(s)
    2. optional uncomment FallbackDNS= and add some public name servers
  3. Make the changes active by restarting the service with sudo systemctl restart systemd-resolved