![プライベートネットワーク用のbind9 DNSサーバーの構成のサポート](https://rvso.com/image/769302/%E3%83%97%E3%83%A9%E3%82%A4%E3%83%99%E3%83%BC%E3%83%88%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF%E7%94%A8%E3%81%AEbind9%20DNS%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%81%AE%E6%A7%8B%E6%88%90%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88.png)
私のホーム ネットワーク (192.168.0.0/24) には多数のサーバーがあり、これらのマシンの IP アドレスを名前でより簡単に解決できるように、bind9 を DNS サーバーとして設定したいと考えています。
私は次のようにして、ubuntu 20.04 に bind9 をインストールして設定しました --このチュートリアルにかなり忠実に従う。
2つのゾーン: epicsystems.local.com - /etc/bind/zones/db.epicsystems.local.com
$TTL 604800
@ IN SOA ns1.epicsystems.local.com. admin.epicsystems.local.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
; name servers - NS records
IN NS ns1.epicsystems.local.com.
; name servers - A records
ns1.epicsystems.local.com. IN A 192.168.0.69
; 192.168.0.0/16 - A records
host2.epicsystems.local.com. IN A 192.168.0.67
host1.epicsystems.local.com IN A 192.168.0.66
db.192.168 -- 逆引きゾーン
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.epicsystems.local.com. admin.epicsystems.local.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
;name servers - NS records
IN NS ns1.epicsystems.local.com.
;PTR records
69.0 IN PTR ns1.epicsystems.local.com. ;192.168.0.69
66.0 IN PTR host1.epicsystems.local.com. ;192.168.0.66
67.0 IN PTR host2.epicsystems.local.com. ;192.168.0.67
/etc/bind/named.conf.local の 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 "epicsystems.local.com"{
type master;
file "/etc/bind/zones/db.epicsystems.local.com"; #zone file path
};
zone "168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.192.168"; #192.168.0.0/16 subnet
};
confとゾーンの構文をチェックしました - 構文的には有効ですが、働く。
ローカル Mac に DNS サーバー 192.168.0.69 を割り当て、ubuntu.com の nslookup を試したところ、うまくいきました。つまり、bind9 はその程度まで機能しているということです。
その後、host1 または host2 に対して nslookup を実行しようとすると失敗します。bind9 のその他のログには、設定されているゾーンが表示されます。
09-Aug-2021 21:23:34.627 zoneload: info: managed-keys-zone: loaded serial 11
09-Aug-2021 21:23:34.627 zoneload: info: zone 0.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.631 zoneload: info: zone 255.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.635 zoneload: info: zone 127.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.635 zoneload: info: zone 168.192.in-addr.arpa/IN: loaded serial 3
09-Aug-2021 21:23:34.639 zoneload: info: zone localhost/IN: loaded serial 2
09-Aug-2021 21:23:34.639 zoneload: info: zone epicsystems.local.com/IN: loaded serial 3
09-Aug-2021 21:23:34.639 general: notice: all zones loaded
09-Aug-2021 21:23:34.639 general: notice: running
09-Aug-2021 21:23:34.743 dnssec: info: managed-keys-zone: Key 20326 for zone . is now trusted (acceptance timer complete)
09-Aug-2021 21:23:34.811 resolver: info: resolver priming query complete
09-Aug-2021 21:23:42.131 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.143 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.163 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.231 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.247 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.335 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.347 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.415 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.603 dnssec: info: validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.623 dnssec: info: validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.707 dnssec: info: validating com/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.715 dnssec: info: validating com/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:20.508 dnssec: info: validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:20.528 dnssec: info: validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.244 dnssec: info: validating cloud/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.260 dnssec: info: validating cloud/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.324 dnssec: info: validating cloud/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.340 dnssec: info: validating cloud/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:36.973 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:36.989 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:37.005 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:37.093 dnssec: info: validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:29:26.277 dnssec: info: validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:29:26.577 dnssec: info: validating net/DNSKEY: got insecure response; parent indicates it should be secure
query.log には、host1 の検索が到着したが、何も解決されていないことが示されています。
09-Aug-2021 21:25:15.148 client @0x7f1cc0005910 192.168.0.13#49292 (host1.epicsystems.local.com): query: host1.epicsystems.local.com IN A + (192.168.0.69)
09-Aug-2021 21:25:36.941 client @0x7f1cbc00a550 192.168.0.13#58522 (host1): query: host1 IN A + (192.168.0.69)
ここで私が何を間違えたのか、誰か分かりますか? DNS サーバーを設定するのは初めてなので、どこかで間違いを犯した可能性が高いです。
答え1
host1.epicsystems.local.com IN A 192.168.0.66
このレコードには末尾のドットがありません。つまり、バインド DNS サーバーは、これを使用したい完全修飾ドメイン名としてではなく、省略形として扱います。
Bind は $ORIGIN (ゾーン名) を短縮レコードに追加し、host1.epicsystems.local.com.epicsystems.local.com.
おそらく意図したものではない A レコードを作成します。