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

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

問題を解決するために多くの時間を費やしましたが、この問題を解決するために必要な作業は完了しませんでした。ファイル権限に問題があるのではないかと考えています。次のコマンドを使用して、マスター サーバーからのゾーン転送を確認するように変更しました。

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

};

以下はマスター サーバーからのファイル権限のスナップショットです。スレーブ サーバーの場合も同様です。

ここに画像の説明を入力してください

N:BIはdig ns.insec -t axfrスレーブからは動作できるが、マスターサーバーからは動作しない

答え1

任意のオプションのグローバル宣言 ( 内)は、同じオプションのローカル宣言 ( 内、options内など) によって上書きできます。zoneview

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

ゾーン定義allow-transfer { 172.31.31.48; 127.0.0.1; };の宣言によって上書きされるグローバル オプションがあります。そのため、ゾーンを localhost に転送することはできません。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"

関連情報