knot-resolver won't start
I've tried everything. What's wrong?
This was the status when I first installed it onto Ubuntu-18.04 on Jan 1, 2021. Things may have changed since then.
If you are using systemd to run the knot resolver and it fails you will be told
to journalctl -xe
and you will learn 1) that it failed to start
and 2) that it returned an error code.
The good stuff isn't in the journal. It is buried in the CGroup part of the
filesystem. Here's how to get it.
systemctl status system-kresd.slice
When I installed knot-resolver I used Ubuntu's package manager apt
to install the dot-deb. Having mucked about with debs I learned that each one
contains a file system overlay that starts at / and contains all the bits it
wants to install already in their appropriate place: "/etc/my-stuff.conf",
"/usr/local/bin/my-program", etc. knot-resolver requires a cache directory.
It's not in the .deb and it's not created on startup. Create it
yourself and you should be ready to go.
mkdir /var/cache/knot-resolver
chown knot-resolver:knot-resolver /var/cache/knot-resolver
systemctl start kresd@1
One more possible gotcha comes if the resolver is listening on lo. Both knotd or knot-resolver can listen on lo, but not at the same time. It's one or the other.