这是我第二个问题的后续问题。@mpboden 的解决方案已实施。此外,我添加了auto-trust-anchor-file:
和启用remote-control:
,如未绑定示例中为其余网络示例设置所定义。
server:
directory: "/etc/unbound"
username: "unbound"
chroot: ""
verbosity: 1
logfile: "/etc/unbound/unbound.log"
pidfile: "/etc/unbound/unbound.pid"
# location of the trust anchor file that enables DNSSEC
auto-trust-anchor-file: "/var/lib/unbound/root.key"
# send minimal amount of information to upstream servers to enhance privacy
qname-minimisation: yes
# The port number on which the server responds to queries.
port: 3000
# the interface that is used to connect to the network (this will listen to all interfaces)
interface: 0.0.0.0
interface: ::0
# addresses from the IP range that are allowed to connect to the resolver
access-control: 192.168.1.0/24 allow
access-control: 2001:DB8::/64 allow
remote-control:
# allows controling unbound using "unbound-control"
control-enable: yes
但是,我在调试模式下发现了 4 个错误和 1 个失败消息。通过我的故障排除工作,我发现这些错误和失败消息在control-enable: yes
允许的情况下发生。
root@DNS:/etc/unbound# unbound -d -vv -c unbound.conf
[1730259092] unbound[6165:0] notice: Start of unbound 1.19.2.
[1730259092] unbound[6165:0] error: Error for server-cert-file: /etc/unbound/unbound_server.pem
[1730259092] unbound[6165:0] error: Error in SSL_CTX use_certificate_chain_file crypto error:80000002:system library::No such file or directory
[1730259092] unbound[6165:0] error: and additionally crypto error:10080002:BIO routines::system lib
[1730259092] unbound[6165:0] error: and additionally crypto error:0A080002:SSL routines::system lib
[1730259092] unbound[6165:0] fatal error: could not set up remote-control
我已检查过是否/var/lib/unbound/root.key
存在。Unbound 仍可工作但unbound-control
无法使用。Unbound 正在寻找/etc/unbound/unbound_server.pem
但该文件不存在。我该如何解决此远程控制配置问题?
更新:
通过@mpboden的回答,我发现该命令unbound-control-setup
旨在在 /etc/unbound 中创建这些文件:unbound_control.pem
,,,, 以允许远程控制。unbound_server.pem
unbound_control.key
unbound_server.key
root@DNS:/etc/unbound# unbound-control-setup -h
usage: /usr/sbin/unbound-control-setup OPTIONS
OPTIONS
-d <dir> used directory to store keys and certificates (default: /etc/unbound)
-h show help notice
-r recreate certificates
root@DNS:/etc/unbound# unbound-control-setup
setup in directory /etc/unbound
Certificate request self-signature ok
subject=CN = unbound-control
removing artifacts
Setup success. Certificates created. Enable in unbound.conf file to use
root@DNS:/etc/unbound# ls
unbound.conf unbound.conf.d unbound.pid unbound_control.pem unbound_server.pem
unbound.log unbound_control.key unbound_server.key
要启用
unbound-control
,您必须运行unbound-control-setup
创建必要文件的命令。引用有关如何设置远程控制的官方文档:
因此,运行以下命令: