我该如何解决named.service is not active, cannot reload.
?的输出/etc/init.d/named status
是
● named.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-05-15 16:24:00 UTC; 2h 42min ago
Docs: man:named(8)
Process: 55460 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 55460 (code=exited, status=1/FAILURE)
May 15 16:24:00 sturtz named[55460]: listening on IPv4 interface lo, 127.0.0.1#53
May 15 16:24:00 sturtz named[55460]: creating TCP socket: address in use
May 15 16:24:00 sturtz named[55460]: listening on IPv4 interface enp0s25, 192.168.0.5#53
May 15 16:24:00 sturtz named[55460]: creating TCP socket: address in use
May 15 16:24:00 sturtz named[55460]: unable to listen on any configured interfaces
May 15 16:24:00 sturtz named[55460]: loading configuration: failure
May 15 16:24:00 sturtz named[55460]: exiting (due to fatal error)
May 15 16:24:00 sturtz systemd[1]: named.service: Main process exited, code=exited, status=1/FAILURE
May 15 16:24:00 sturtz systemd[1]: named.service: Failed with result 'exit-code'.
May 15 19:02:52 sturtz systemd[1]: named.service: Unit cannot be reloaded because it is inactive.
我无法弄清楚错误或如何解决它。我正在运行 Ubuntu Server 20.04 LTS,我昨天安装了它,我在这里询问了 Bind9 设置
当我运行时sudo ss -tulpn | grep :53
:
sudo: unable to resolve host sturtz: Name or service not known
udp UNCONN 0 0 192.168.0.5:53 0.0.0.0:* users:(("named",pid=34374,fd=30))
udp UNCONN 0 0 192.168.0.5:53 0.0.0.0:* users:(("named",pid=34374,fd=31))
udp UNCONN 0 0 127.0.0.1:53 0.0.0.0:* users:(("named",pid=34374,fd=24))
udp UNCONN 0 0 127.0.0.1:53 0.0.0.0:* users:(("named",pid=34374,fd=25))
udp UNCONN 0 0 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=826,fd=12))
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("mdns-publisher",pid=1229,fd=5))
udp UNCONN 0 0 [::1]:53 [::]:* users:(("named",pid=34374,fd=36))
udp UNCONN 0 0 [::1]:53 [::]:* users:(("named",pid=34374,fd=35))
udp UNCONN 0 0 [fe80::223:24ff:fe08:581f]%enp0s25:53 [::]:* users:(("named",pid=34374,fd=40))
udp UNCONN 0 0 [fe80::223:24ff:fe08:581f]%enp0s25:53 [::]:* users:(("named",pid=34374,fd=41))
udp UNCONN 0 0 [::]:5353 [::]:* users:(("mdns-publisher",pid=1229,fd=6))
tcp LISTEN 0 10 192.168.0.5:53 0.0.0.0:* users:(("named",pid=34374,fd=34),("named",pid=34374,fd=33),("named",pid=34374,fd=32))
tcp LISTEN 0 10 127.0.0.1:53 0.0.0.0:* users:(("named",pid=34374,fd=29),("named",pid=34374,fd=28),("named",pid=34374,fd=27))
tcp LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=826,fd=13))
tcp LISTEN 0 10 [fe80::223:24ff:fe08:581f]%enp0s25:53 [::]:* users:(("named",pid=34374,fd=44),("named",pid=34374,fd=43),("named",pid=34374,fd=42))
tcp LISTEN 0 10 [::1]:53 [::]:* users:(("named",pid=34374,fd=39),("named",pid=34374,fd=38),("named",pid=34374,fd=37))
所以你有两个问题:
(1)我们杀死然后开始
named
运行的陈旧进程sudo killall -9 named
sudo systemctl start named.service
(2) 配置问题 -
forwarders
DNS 位需要您有实际的 IP 地址而不是主机名。这就是说,您正在通过 CloudFlare 运行您的站点,为什么您需要自己的 DNS 呢?无论如何,这两个问题都已解决。有关此问题的详细讨论,请参阅评论中提到的聊天室。