web-dev-qa-db-ja.com

ゾーン転送が拒否されました

私は問題を解決するのに何時間も費やしましたが、この問題を解決するために必要なことを完了できませんでした。

Dig ns.insec -t axfr

マスターサーバーからのエラーメッセージを次に示します。

Mar 16 03:49:30 ip-172-31-22-11 named[5395]: client        127.0.0.1#37251    
    (ns.insec): zone transfer 'ns.insec/AXFR/IN' denied

named.conf.optionsファイルは次のとおりです。

acl "trusted" {
    localhost;
    172.31.0.0/20;
    localnets;
};

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 {
        8.8.8.8;
     };

    //========================================================================
    // 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; };
    forward only;
    allow-query-cache { trusted; };
    allow-query { trusted; };
    allow-recursion { trusted; };
    recursion yes;
    allow-transfer { 172.31.31.48; 127.0.0.1; };
    //also-notify { trusted; };
};

これが私のnamed.conf.localファイルです:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "ns.insec" {
    type master;
    file "/etc/bind/zones/db.ns.insec";
    allow-transfer { 172.31.31.48; };
    also-notify { 172.31.31.48; };
};

// 172.31.31.48 is the IP for slave 
// 172.31.22.11 is the IP for the master
zone "22.31.172.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.172.31.22";
    allow-transfer { 172.31.31.48; };
    also-notify { 172.31.31.48; };

};

これは、マスターサーバーからのファイルアクセス許可のスナップショットであり、スレーブサーバーでも同じです。

enter image description here

N:BスレーブからDig ns.insec -t axfrできますが、マスターサーバーからはできませんが動作します

1
bhordupur

任意のオプションのグローバル宣言(options内)は、同じオプションのローカル宣言(たとえば、zoneview内)で上書きできます。

同じことがあなたの場合にも起こっています。

ゾーン定義allow-transfer { 172.31.31.48; 127.0.0.1; }; as zone "ns.insec"の宣言によって上書きされるグローバルオプションallow-transfer { 172.31.31.48; };があります。したがって、ゾーンをローカルホストに転送することはできません。

これを解決するには、zone "ns.insec"で次のように宣言します。

allow-transfer { 172.31.31.48; 127.0.0.1; };

または、グローバルなものを使用する場合(常に良い考えではありません)、allow-transferディレクティブをzone "ns.insec"定義から削除します。

0
heemayl