同じサーバーで Bind9 が拒否されました。

同じサーバーで Bind9 が拒否されました。

Dockerコンテナで実行されているローカルBIND9 DNSサーバーがあります。他のコンテナでは、外部からホームネットワークへの接続に使用するWireguardを実行します。

私が経験している問題は、サーバーIPをWireguardのDNSとして選択したときにBIND9が引き続きクエリを拒否することです。ルータをDNSとして選択し、BIND9 DNSに転送すると、すべてが期待どおりに機能します。

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

# BEGIN MANAGED HOMENETWORK BLOCK
acl homenetwork {
  192.168.1.0/24; # home network
  172.17.0.1; # docker host
  192.168.4.0/24; # Wireguard network
  localhost;
  localnets;
};
# END MANAGED HOMENETWORK BLOCK
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;

# BEGIN MANAGED CACHING BLOCK
recursion yes;
allow-query { homenetwork; };
auth-nxdomain no; # conform to rfc1035
# END MANAGED CACHING BLOCK
    listen-on-v6 { any; };
};

問題のIPは、BIND(Docker)の場合は172.17.0.5、Wireguard(Docker)の場合は172.17.0.7、192.168.4.2(Wireguardクライアント)です。

間違い

03-Oct-2023 20:44:52.999 client @0x7ff680007460 172.17.0.1#60081 (gitlab.lan): query 'gitlab.lan/A/IN' denied

acl設定しようとしましたが、any;同じエラーが発生するため、別のものに違いありません。どのようなヒントがありますか?

ベストアンサー1

zone私もこの設定を持っていることがわかりました:

zone "lan" {
  type master;
  file "/var/lib/bind/lan.hosts";
  allow-query {
    192.168.1.0/24;
  };
};

また、正しく機能するには、クエリを許可するように更新する必要があります。最後の構成は次のとおりです。

名前.conf.local

zone "lan" {
  type master;
  file "/var/lib/bind/lan.hosts";
  allow-query {
    192.168.1.0/24;
    172.17.0.1; 
  };
};

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

acl homenetwork {
  # home network
  192.168.1.0/24; 
  # docker host
  172.17.0.1; 
  localhost;
  localnets;
};

おすすめ記事