大网数据广告活动
服务器运维问答

Unbound doesnt start

· 52CE 我爱测

after installing Unbound apt-get -y install unbound dnsutils su -c "unbound-anchor -a /var/lib/unbound/root.key" - unbound systemctl reload unbound apt-get -y install resolvconf echo "nameserver 127.0.0.1" >> /etc/resolvconf/reso…

问题原文

原帖链接 · Aeris · CC BY-SA 3.0

after installing Unbound

apt-get -y install unbound dnsutils

su -c "unbound-anchor -a /var/lib/unbound/root.key" - unbound
systemctl reload unbound

apt-get -y install resolvconf
echo "nameserver 127.0.0.1" >> /etc/resolvconf/resolv.conf.d/head

I'm not able to start it properply:

root@xyz:~/asdf# service unbound status
● unbound.service - Unbound DNS server
   Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2017-12-29 13:59:49 CET; 81ms ago
     Docs: man:unbound(8)
  Process: 1676 ExecStart=/usr/sbin/unbound -d $DAEMON_OPTS (code=exited, status=1/FAILURE)
  Process: 1670 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
  Process: 1665 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
 Main PID: 1676 (code=exited, status=1/FAILURE)

Dec 29 13:59:49 mail systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 13:59:49 mail systemd[1]: unbound.service: Unit entered failed state.
Dec 29 13:59:49 mail systemd[1]: unbound.service: Failed with result 'exit-code'.

Hosts file content:

127.0.0.1   localhost
127.0.1.1   mail.xyz.de  mail

::1         localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

I'm really confused about that error.

Edit: journalctl -xe output (shortened):

Dec 29 16:01:04 mail systemd[1]: unbound-resolvconf.service: Unit entered failed state.
Dec 29 16:01:04 mail systemd[1]: unbound-resolvconf.service: Failed with result 'start-limit-hit'.
Dec 29 16:01:04 mail unbound[59226]: [1514559664] unbound[59226:0] error: can't bind socket: Cannot assign requested address for ::1
Dec 29 16:01:04 mail unbound[59226]: [1514559664] unbound[59226:0] fatal error: could not open ports
Dec 29 16:01:04 mail systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 16:01:04 mail systemd[1]: unbound.service: Unit entered failed state.
Dec 29 16:01:04 mail systemd[1]: unbound.service: Failed with result 'exit-code'.
Dec 29 16:01:04 mail systemd[1]: unbound-resolvconf.service: Start request repeated too quickly.
Dec 29 16:01:04 mail systemd[1]: Failed to start Unbound DNS server via resolvconf.
-- Subject: Unit unbound-resolvconf.service has failed

Edit 2: Arno Ip tables is also installed on the system!

Edit 3: Ipv6 is disabled, if this is related to the error.

net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 net.ipv6.conf.ens3.disable_ipv6 = 1

Edit 4: This is my /etc/unbound/unbound.conf after installing it via apt-get

# Unbound configuration file for Debian.
#
# See the unbound.conf(5) man page.
#
# See /usr/share/doc/unbound/examples/unbound.conf for a commented
# reference config file.
#
# The following line includes additional configuration files from the
# /etc/unbound/unbound.conf.d directory.
include: "/etc/unbound/unbound.conf.d/*.conf"

I changed it to:

server:
        interface: 127.0.0.1

include: "/etc/unbound/unbound.conf.d/*.conf"

But it doesnt work either :/

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

The error messages show that having disabled IPv6 caused the problem.

Dec 29 16:01:04 mail unbound[59226]: [1514559664] unbound[59226:0] error: can't bind socket: Cannot assign requested address for ::1
Dec 29 16:01:04 mail unbound[59226]: [1514559664] unbound[59226:0] fatal error: could not open ports

IPv6 really isn't optional anymore. It hasn't been for a while. The best thing to do, of course, is to not disable IPv6 on the system.

If you can't do that for some reason, then check your unbound.conf for interface and control-interface directives that specify IPv6 addresses and remove them. Note that the default for control-interface is to listen on both 127.0.0.1 and ::1, so you'll have to specify it explicitly if you don't want ::1.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。