영역 전송이 거부되었습니다.

영역 전송이 거부되었습니다.

문제를 해결하는 데 많은 시간을 보냈지만 이 문제를 해결하는 데 필요한 작업을 수행하지 못했습니다. 파일 권한에 문제가 있을 수 있다고 생각합니다. 다음 명령을 사용하여 마스터 서버에서 영역 전송을 확인하고 싶었습니다.

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

모든 옵션의 전역 선언(in ) 은 동일한 옵션의 로컬 선언(예: in , ) options으로 덮어쓸 수 있습니다 .zoneview

당신의 경우에도 같은 일이 일어나고 있습니다.

allow-transfer { 172.31.31.48; 127.0.0.1; };영역 정의의 선언으로 덮어쓰여지는 zone "ns.insec"전역 옵션이 있습니다 allow-transfer { 172.31.31.48; };. 따라서 영역을 localhost로 전송할 수 없습니다.

zone "ns.insec"이 문제를 해결하려면 다음과 같이 선언하십시오.

allow-transfer { 172.31.31.48; 127.0.0.1; };

또는 전역적인 것을 사용하려면(항상 좋은 생각은 아닙니다) 정의 allow-transfer에서 지시어를 제거하세요.zone "ns.insec"

관련 정보