Esta é uma pergunta de acompanhamento para minha 2ª pergunta . A solução de @mpboden foi implementada. Além disso, adicionei auto-trust-anchor-file:
e enabled remote-control:
, conforme definido no exemplo Unbound para Setting up para o restante do exemplo de rede .
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
No entanto, descobri 4 erros e 1 mensagem de falha usando o modo de depuração. Com meus esforços de solução de problemas, descobri que essas mensagens de erro e falha ocorriam sempre que control-enable: yes
era permitido.
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
Verifiquei que /var/lib/unbound/root.key
existe. O Unbound ainda funciona, mas unbound-control
não pode ser usado. O Unbound está procurando, /etc/unbound/unbound_server.pem
mas este arquivo não existe. Como resolvo este problema de configuração de controle remoto?
Atualizar:
com a resposta do @mpboden , descobri que o comando unbound-control-setup
serve para criar esses arquivos em /etc/unbound: unbound_control.pem
, unbound_server.pem
, unbound_control.key
, unbound_server.key
, para permitir o controle remoto.
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
Para habilitar
unbound-control
, você precisa executar ounbound-control-setup
comando que cria os arquivos necessários.Citando a documentação oficial sobre como configurar o controle remoto :
Portanto, execute o seguinte comando: