knotc [parameters] action [action_args]
If the optional zone argument is not specified, the command is applied to all zones.
$ keymgr tsig generate knotc-key > knotc-key.conf
The generated key file contains a key in the server configuration format and thus can be directly included into the server configuration file.
Knot DNS utilities accept one-line format which is included in the generated key file on the first line as a comment. It can be extracted easily:
$ head -1 knotc-key.conf | sed 's/^#\s*//' > knotc.key
Make sure the key file can be read only by the owner for security reasons.
$ knotc -s 127.0.0.1 -k knotc.key reload
$ knotc -c knot.conf flush
knotd(8), knot.conf(5).