ユーザーが VPN (OpenVPN) に接続するときに、ネットワーク サーバーの名前を解決するためだけに DNS サーバーをセットアップする必要があります。DNS サーバーの IP アドレスをクライアントに正常に「プッシュ」できます。ローカル ネットワークに Bind9 を使用して DNS サーバーをセットアップするのは簡単だと思い込んでいました。私は間違っていた。まず、Google から見つけたすべてのサンプルは、ローカル名ではなく、完全修飾ドメインに基づいています。私がローカル名と呼んでいるのは、「server1.my.company.com」ではなく、「server1」のようなものです。しかし、有名な「@」を発見しました。
今、私は別の問題を抱えています。「ping」または「nslookup」で「server1」を試すと、まさに私が望んでいることを行います。「server1」を内部 IP に解決します。偉大な。しかし、「www.google.com」を試してみると、IP の解決に失敗します。つまり、クライアントは、まだ DNS サーバーのリストにあるインターネット プロバイダーの DNS サーバーではなく、私の DNS サーバーを使用して「www.google.com」を解決しようとします。
クライアント マシンに伝える方法はありますか: I don't know this person, see someone else ?
「auth-nxdomain」がデフォルトで「no」に設定されていることに気付きました。「はい」に設定しようとしましたが、うまくいきません。
Ubuntu 9.04 の下に Bind9 の構成ファイルがあります。
/etc/bind/named.conf.options
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;
// };
//auth-nxdomain no; # conform to RFC1035
auth-nxdomain yes;
listen-on-v6 { any; };
// To prevent the error ";; Got recursion not available from 10.8.0.1, trying next server"
allow-recursion { 10.8.0.0/24; };
};
/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";
// This is the zone definition.
zone "@" {
type master;
file "/etc/bind/zones/vpn.db";
};
// This is the zone definition for reverse DNS.
zone "0.8.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.8.10.in-addr.arpa";
};
/etc/bind/zones/vpn.db
@ IN SOA vpn.local. admin.local. (
2011041608 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
);
@ IN NS vpn.local.
server1 IN A 10.8.0.1
/etc/bind/zones/rev.0.8.10.in-addr.arpa
@ IN SOA vpn.local. admin.local. (
2011041608 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
);
@ IN NS vpn.local.
1 IN PTR mrsvn
「SOA」については何もわかりません。例から数字をコピーしました。そして、「vpn.local」についてはよくわかりません。および「admin.local」。とにかく、DNSサーバーは機能します。私は多くのことをしなければならないので、とても単純なタスクを実行する前に 1000 ページのテキストを読む時間はありません。サーバー側で自分の DNS サーバーにリクエストを転送する必要がありますか? オプションファイルの "forwarders {...}" を変更して試しましたが、うまくいきません。そして、VPN を介してすべての DNS 解決を行うという考えは好きではありません。解決策はありますか?