kresd.systemd(8)

NAME
kresd.systemd - managing Knot DNS Resolver through systemd.

SYNOPSIS
kresd@.service
kresd@.socket
kresd-tls@.socket
kresd-control@.socket

DESCRIPTION

This manual page describes how to manage kresd using systemd units. Depending on your distribution, this can be either be done with socket-based activation or without it. The following assumes socket-based activation. For differences see NOTES below. kresd daemon can be executed in multiple independent processes, which can be managed with systemd via systemd templates (see systemd.unit(5)). Each systemd service instance of kresd (kresd@.service) represents a single, independent kresd process. Each instance of kresd@.service has three systemd sockets (see systemd.socket(5)) associated with it:
    kresd@.socket - UDP/TCP network socket (default: localhost:53)
    kresd-tls@.socket - network socket for DNS-over-TLS (default: localhost:853)
    kresd-control@.socket - UNIX socket with control terminal
Configuring network interfaces When using socket-based activation, the daemon doesn't require root privileges nor any capabilities, because the sockets are created by systemd and passed to kresd. This means kresd can't bind to ports below 1024 when configured in /etc/knot-resolver/kresd.conf. To configure kresd to listen on public interfaces, drop-in files (see systemd.unit(5)) should be used. These can be created with:
    systemctl edit kresd@.socket
    systemctl edit kresd-tls@.socket
For example, to configure kresd to listen on 192.0.2.115 on ports 53 and 853, the drop-in files would look like:
    # /etc/systemd/system/kresd@.socket.d/override.conf
    [Socket]
    ListenDatagram=192.0.2.115:53
    ListenStream=192.0.2.115:53
    # /etc/systemd/system/kresd-tls@.socket.d/override.conf
    [Socket]
    ListenStream=192.0.2.115:853

NOTES

*   When kresd@.service is started, stopped or restarted, its associated sockets are also automatically started, stopped or restarted.

*   If your distribution doesn't use socket-based activation, you can configure the network interfaces for kresd in /etc/knot-resolver/kresd.conf. The service can be started or enabled in the same way as in the examples below, but it doesn't have any sockets associated with it.

EXAMPLES
Single instance
    To start the service:
        systemctl start kresd@1.service
    To start the service at boot:
        systemctl enable kresd@1.service
    To delay the service startup until some traffic arrives, start (or enable) just the sockets:
        systemctl start kresd@1.socket
        systemctl start kresd-tls@1.socket
    To disable the TLS socket, you can mask it:
        systemctl mask kresd-tls@1.socket
Multiple instances
    Multiple instances can be handled with the use of Brace Expansion (see bash(1)). To start multiple instances, for example 16:
        systemctl start kresd@{1..16}.service

SEE ALSO
kresd(8), systemd.unit(5), systemd.socket(5), https://knot-resolver.readthedocs.io

AUTHORS
kresd developers are mentioned in the AUTHORS file in the distribution.