web-dev-qa-db-ja.com

Bind9を開始できません。rndc接続に失敗しました

Virtualminをインストールし、DNS設定をいじりました。 bind9を起動しようとすると、エラーが発生します。

Service bind9 restart

 * Stopping domain name service... bind9   
   rndc: connect failed: 127.0.0.1#953: connection refused
                                                                    [ OK ]
 * Starting domain name service... bind9                            [fail]

/ var/log/syslog

Oct 11 06:05:45 stock named[6316]: starting BIND 9.8.1-P1 -u bind
Oct 11 06:05:45 stock named[6316]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'
Oct 11 06:05:45 stock named[6316]: adjusted limit on open files from 4096 to 1048576
Oct 11 06:05:45 stock named[6316]: found 4 CPUs, using 4 worker threads
Oct 11 06:05:45 stock named[6316]: using up to 4096 sockets
Oct 11 06:05:45 stock named[6316]: loading configuration from '/etc/bind/named.conf'
Oct 11 06:05:45 stock named[6316]: /etc/bind/named.conf.options:26: expected IPv4 address or '*' near ';'
Oct 11 06:05:45 stock named[6316]: loading configuration: unexpected token
Oct 11 06:05:45 stock named[6316]: exiting (due to fatal error)

/ etc/bind/named.conf.options

options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable 
    // nameservers, you probably want to use them as forwarders.  
    // Uncomment the following block, and insert the addresses replacing 
    // the all-0's placeholder.

    // forwarders {
    //  0.0.0.0;
    // };

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
//  allow-recursion { 127.0.0.1; };
    transfer-source;
};
3
Nyxynyx

エラーメッセージは、実際には一目瞭然です。 named.conf(4)に記載されているように、オプションtransfer-sourceの後には、IPv4アドレスまたはトークンが続く必要があります*、構成の26行目にはベアキーワードしかないが、

transfer-source;

修正するとエラーは解消されます。

2
Ansgar Wiechers

named.confの設定に問題があります:

Oct 11 06:05:45 stock named[6316]: /etc/bind/named.conf.options:26: expected IPv4 address or '*' near ';'
Oct 11 06:05:45 stock named[6316]: loading configuration: unexpected token

Windowsでnamed.confを編集する場合は、named.confをUnix形式に変換する必要があります。 Linuxからdos2unixを使用できます。

0
tasmanian_devil