名前付き構成ファイル

名前付き構成ファイル

OpenDNSサーバーの単純フォワーダーとして機能できる単純バインドサーバーを設定したいと思います。

私はバインディングがルートサーバーにクエリできるようにしたくないので、すべてのトラフィックがOpenDNSにのみ移動してそれに対する「キャッシュ」として機能するようにしたいと思います。

この目標を達成する方法は?どういうわけかルートサーバープロンプトを無効にする必要がありますか?これは正しい手順ですか?

私の考えでは、ルートサーバーが提供する"。"領域をコメントアウトしているようです。名前付き.conf.defaultzone文書。しかし、再帰を無効にするとクエリではなくルートサーバーも達成できると読みましたが、再帰を無効にするとサーバーもフォワーダを利用できなくなるようです。私のconfに何の問題がありますか?

会議の内容は次のとおりです。

名前付き構成ファイル

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

名前付き.conf.オプション

acl "trusted" {
        127.0.0.1/8;
        10.0.0.0/8;
        172.16.0.0/12;
        192.168.0.0/16;
        ::1;
};

options {

        directory "/var/cache/bind";    # bind cache directory

        recursion no;                   # enables resursive queries

        allow-query { trusted; } ;

        allow-recursion { "none"; };
        additional-from-cache no;

        allow-transfer { none; };       # disable zone transfers by default

        // 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.

        forward only;

        forwarders {
                208.67.222.222;
                208.67.220.220;
        };


        //========================================================================
        // 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-enable no;
        dnssec-validation no;
        dnssec-lookaside auto;


        auth-nxdomain no;               # conform to RFC1035

};

名前.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";

名前付き.conf.defaultzone

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

ベストアンサー1

BIND構成は、定義されている場合、ローカルBINDで満たされていないすべての要求をフォワーダーに送信します。

また、forward only;使用時にローカル領域は無視され、すべての要求はキャッシュまたはフォワーダによってのみ満たされます。

ローカルゾーン(つまり、RFC 1918のプライベートIPアドレスとローカルホーム/オフィスエリア)が必要な場合は、フォワーダを持つためにルートヒントとディレクティブでゾーンにコメントを付ける必要がありますforward only;

// forward only;

// zone "." {
//    type hint;
//    file "/etc/bind/db.root";
// };

~からDNSの使い方

ただし、「転送専用」が設定されている場合、BINDはフォワーダから応答が受信されない場合は放棄し、gethostbyname()はすぐに返されます。したがって、/ etcにあるファイルを調整してサーバーを再起動する必要はありません。

私の場合は、数行だけ追加しました。

配信のみ。貨物運送業者{193.133.58.5};

名前付き.confファイルのオプション{}セクションに移動します。それは非常にうまく動作します。これの唯一の欠点は、非常に複雑なDNSソフトウェアを愚かなキャッシュ状態に縮小することです。

したがって、単純なキャッシュだけが必要な場合は、要求を渡すだけです。これは、要求を中央オフィスに転送するなど、企業環境に適した構成です。

あなたの場合、要求を外部に転送するときにプライベートforward onlyIPアドレス範囲/ローカルDNS / WindowsドメインへのDNS要求を上位層/ルートネームサーバーに転送することを避けるために、盲目的にそれを行わないことをお勧めします。

おすすめ記事