
サーバーがダウンするほどの深刻な問題に直面しています。
ログで見つかった問題の修復に最善を尽くしたにもかかわらず、何らかの理由で named が動作しなくなりました。
実行しようとするといつもこのエラーが発生します再構築dnsconfig(cパネル)
warn [fixrndc] /usr/sbin/rndc status failed: rndc: connect failed: 127.0.0.1#953: connection refused
そして、named のステータスを確認すると:
root@host [/etc]# /etc/init.d/named status
rndc: connect failed: 127.0.0.1#953: connection refused
これは私の/var/log/messagesの末尾です
root@host [/etc]# tail /var/log/messages
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1, 108.xx.18.18#53
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1:cp1, 108.xx.18.19#53
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1:cp2, 108.xx.18.20#53
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1:cp3, 108.xx.18.21#53
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1:cp4, 108.xx.18.22#53
Nov 24 22:32:25 host named[21687]: listening on IPv4 interface eth1:cp5, 108.xx.18.23#53
Nov 24 22:32:25 host named[21687]: command channel listening on 127.0.0.1#953
Nov 24 22:32:25 host named[21687]: couldn't open pid file '/var/run/named/named.pid': Permission denied
Nov 24 22:32:25 host named[21687]: exiting (due to early fatal error)
Nov 24 22:32:25 host /etc/init.d/named: named startup succeeded
私の構成には次の権限が与えられています:
root@host [/etc]# ls -lh | grep named.conf
-rw-r--r-- 1 named root 4.9K Nov 24 22:11 named.conf
私のnamed.confには次のコードがあります: (ゾーンを除く)
include "/etc/rndc.key";
controls {
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
options {
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
// query-source port 53;
recursion no;
/* We no longer enable this by default as the dns posion exploit
has forced many providers to open up their firewalls a bit */
// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
pid-file "/var/run/named/named.pid";
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
/* memstatistics-file "data/named_mem_stats.txt"; */
allow-transfer { "none"; };
};
rndc の権限:
root@host [/etc]# ls -lh | grep rndc
-rw-rw---- 1 named named 479 Nov 24 21:29 rndc.conf
-rw-rw---- 1 named named 479 Nov 24 21:16 rndc.conf.bak
-rw-rw---- 1 named named 77 Nov 24 21:29 rndc.key
名前付きフォルダーの権限:
ls -lh /var/run/named/
total 8.0K
drwxrwxr-x 2 named named 4.0K Jan 7 2013 ./
drwxrwx--- 22 root root 4.0K Nov 24 22:29 ../
ここで何か目立つものはありますか?
ご協力いただきありがとうございます!
答え1
namedがpidファイルに書き込めないという基本的な問題であることは明らかです。考えられる可能性としては、
- パスワードファイル内の指定ユーザーのエントリが競合しています
- セリナックス
これらの理論をテストする方法についての提案をコメントでお願いします。
named.conf 内の pid ファイルの場所を変更することで問題は解決しましたが、/var/run の下のフォルダー権限に問題がある可能性が高いようです。