名称服务器无响应,无法启动命名

名称服务器无响应,无法启动命名

我试过重启它们

# /sbin/service named restart
Stopping named: [ OK ]
Starting named: [FAILED]

我试过这个来解决这个问题

# yum install dbus

成功完成。但我仍然无法让它们启动。


一些有用的信息

[root@ip-184-168-86-185 /]# /sbin/service named restart
Stopping named:                                            [  OK  ]
Starting named:                                            [FAILED]
[root@ip-184-168-86-185 /]# tail -50 /var/log/messages
2011-09-20T18:32:37.322626-07:00 ip-184-168-86-185 rsyslogd: [origin software="rsyslogd" swVersion="3.22.1" x-pid="3127" x-info="http://www.rsyslog.com"] (re)start
2011-09-20T18:32:37.321006-07:00 ip-184-168-86-185 rsyslogd: WARNING: rsyslogd is running in compatibility mode. Automatically generated config directives may interfer with your rsyslog.conf settings. We suggest upgrading your config and adding -c3 as the first rsyslogd option.
2011-09-20T18:32:37.322354-07:00 ip-184-168-86-185 rsyslogd: Warning: backward compatibility layer added to following directive to rsyslog.conf: ModLoad imuxsock
2011-09-21T11:38:21.437308-07:00 ip-184-168-86-185 shutdown[16303]: shutting down for system reboot
2011-09-21T11:38:22.551115-07:00 ip-184-168-86-185 init: Switching to runlevel: 6
2011-09-21T11:38:22.578505-07:00 ip-184-168-86-185 saslauthd[1834]: server_exit     : master exited: 1834
2011-09-21T11:38:38.059150-07:00 ip-184-168-86-185 xinetd[1422]: Exiting...

-

-rwxr-xr-x  2 root root      381956 Feb 22  2011 named
-rwxr-xr-x  1 root root        7299 Feb 22  2011 named-bootconf
-rwxr-xr-x  1 root root       13640 Feb 22  2011 named-checkconf
-rwxr-xr-x  1 root root       13644 Feb 22  2011 named-checkzone

-

[root@ip-184-168-86-185 /]# grep named /var/log/messages
[root@ip-184-168-86-185 /]# ls -la /etc/named.conf
lrwxrwxrwx 1 root named 32 Feb  1  2011 /etc/named.conf -> /var/named-chroot/etc/named.conf
[root@ip-184-168-86-185 /]# ls -la /etc/rndc.conf
lrwxrwxrwx 1 root named 32 May 23 16:23 /etc/rndc.conf -> /var/named-chroot//etc/rndc.conf
[root@ip-184-168-86-185 /]# nano etc/named.conf
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;

        // don't allow queries for domains we don't know about
        allow-recursion {localnets; };
};

controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "forward.localhost";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "reverse.127.0.0";
        allow-update { none; };
};

include "/etc/rndc.key";

include "/etc/named-turbopanel.conf";

答案1

查看你的最后输出。

2011-09-20T18:32:37.322626-07:00 ip-184-168-86-185 rsyslogd: [origin software="rsyslogd" swVersion="3.22.1" x-pid="3127" x-info="http://www.rsyslog.com"] (re)start
2011-09-20T18:32:37.321006-07:00 ip-184-168-86-185 rsyslogd: WARNING: rsyslogd is running in compatibility mode. Automatically generated config directives may interfer with your rsyslog.conf settings. We suggest upgrading your config and adding -c3 as the first rsyslogd option.
2011-09-20T18:32:37.322354-07:00 ip-184-168-86-185 rsyslogd: Warning: backward compatibility layer added to following directive to rsyslog.conf: ModLoad imuxsock
2011-09-21T11:38:21.437308-07:00 ip-184-168-86-185 shutdown[16303]: shutting down for system reboot
2011-09-21T11:38:22.551115-07:00 ip-184-168-86-185 init: Switching to runlevel: 6
2011-09-21T11:38:22.578505-07:00 ip-184-168-86-185 saslauthd[1834]: server_exit     : master exited: 1834
2011-09-21T11:38:38.059150-07:00 ip-184-168-86-185 xinetd[1422]: Exiting...

看起来服务器正在重新启动,但由于某种原因挂起了。请执行以下操作:

init 3

或者重新启动服务器。(很可能你最终还是会这么做)。

编辑:看起来存在权限问题:

-rw-r----- 1 root root  5572 Sep 21 12:55 named-turbopanel.conf

显然这是今天添加的,这就是为什么您无法正确重新启动命名的原因 - 命名无法读取它。

更改所有权:

chown root:named named-turbopanel.conf

并授予其读取权限:

chmod 644 named-turbopanel.conf

顺便说一句,由于您正在运行 cents,请检查您是否正在运行 SELinux。如果您看到以下输出:

[root@localhost etc]# getenforce
Enforcing

然后您需要赋予它以下 ACL:

chcon -u system_u -t named_conf_t named-turbopanel.conf

然后确保正确标记:

semanage fcontext -a -t named_conf_t named-turbopanel.conf

如果您没有 semanage,您将需要通过 policycoreutils-python 进行安装。

答案2

在前台运行named,以便将消息打印到标准输出

/usr/sbin/named -f 

如果这不能给你足够的信息,请增加调试级别

/usr/sbin/named -f -d n

其中 n >=1,并且增加 n 会产生更多输出。

相关内容