
bind9 を使用して DNS サーバーを作成しようとしていますが、nslookup を使用したり、名前を解決しようとすると、servfail エラーが発生します。
設定ファイルは次のとおりです。
// 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";
smx@smx:~$ cat /etc/bind/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 "thiefhunter.local"{
type master;
file "/etc/bind/zones/db.thiefhunter.local";
};
zone "1.168.192.in-addr.arpa"{
type master;
file "/etc/bind/zones/db.192.168.1";
};
リバースゾーンの設定は次のとおりです。
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.thiefhunter.local root.thiefhunter.local. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS ns1.thiefhunter.local.
ns1 IN A 192.168.1.37
server IN CNAME ns1.thiefhunter.local.
pc01 IN A 192.168.1.36
gw IN A 192.168.1.1
一言コメントします。192.168.1.36 の pc01 が何を意味するのか分かりません。私のネットワークにはこの IP を持つ PC はありませんが、チュートリアルに従うと、そのものが表示されました。アドバイスとして申し訳ありません。
リバースゾーンの設定は次のとおりです。
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.thiefhunter.local root.thiefhunter.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.thiefhunter.local.
10 IN PTR ns1.thiefhunter.local.
1 IN PTR gw.thiefhunter.local.
/etc/bind/named.confは必要ないと思ったので編集しませんでした。
また、クライアント (bind9 サーバー IP を DNS として使用するように構成している) で nslookup を使用しようとしたときのエラーは次のとおりです。
paco@paco-virtualbox:~$ nslookup
> thiefhunter.local
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find thiefhunter.local: SERVFAIL
> 192.168.1.37
** server can't find 37.1.168.192.in-addr.arpa: NXDOMAIN
> 192.168.1
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find 192.168.1: NXDOMAIN
お時間を割いていただき、また読んでいただきありがとうございました
答え1
あなたは少し混乱しているように見えます、あるいは悪いチュートリアルを見ているようです。
最初のゾーンファイルは逆DNSには役立ちません。これは、thiefhunter.localで終わるドメインをIPアドレスに変換するフォワードルックアップです。レコードを追加する必要があります。
server 192.168.1.37
これは逆引きを行う 2 番目のゾーン ファイルです。IP をドメインに変換するには、適切なエントリを追加する必要があります。
この左側は IP アドレスの最後の桁です (この場合は 37)。右側は解決するドメイン名です (例: mymachine.thiefhunter.local)。
37 server.thiefhunter.local.
「pc01 IN A 192.168.1.36」は、pc01.thiefhunter.local を IP アドレス 192.168.1.36 に変換するエントリです。この IP にマシンが存在しない場合は削除できます。