Named.Service 未处于活动状态

Named.Service 未处于活动状态

我该如何修复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

所以你有两个问题:

(1)named正在运行的陈旧进程,我们先将其终止sudo killall -9 named,然后启动sudo systemctl start named.service

(2) 配置问题 - forwardersDNS 需要您拥有实际的 IP 地址而不是主机名。话虽如此,您是通过 CloudFlare 运行您的网站的,为什么您需要自己的 DNS 呢?

无论如何,这两个问题都已修复。请参阅评论中提到的聊天室以了解对此的详细讨论。

相关内容