Sha*_*ane 4 domain-name-system bind domain-controller
我要么无法理解 DNS 的工作原理,要么无法正确配置我的 DNS(两者都不好)。我目前正在使用一个域,我将其称为webdomain.com,我需要允许我们所有的内部用户像世界其他地方一样访问 dotster 以获取我们的公共 DNS 条目。然后,最重要的是,我希望能够提供一些覆盖 DNS 条目,用于测试未公开提供的服务器和设备。举个例子:
external.webdomain.com - 也应该从 dotster 获取
testing.webdomain.com - 应该从我的内部 dns 控制器获取
我似乎处处遇到的问题是,如果我有一个包含 webdomain.com 区域的内部 DNS 控制器,那么我可以获取指定的内部条目,但永远不会从公共 DNS 服务器获取任何内容。无论我使用什么类型的 DNS 服务器,这都是正确的——我已经尝试了 Linux Bind9 和 Windows 2008 域控制器。
我想我的大问题是:我认为系统应该能够检查我指定的内部 DNS 并且在请求的条目不存在的情况下它应该故障转移到指定的公共 dns 服务器是不合理的 - 或者 -这难道不是 DNS 的工作方式,而我迷失在酱汁中吗?
看起来它应该像告诉我的内部 DNS 服务器将它无法满足的任何请求转发给 dotster 一样简单,但这似乎不起作用。这可能是防火墙问题吗?
提前致谢
扩展
好的,所以我做了大量的研究,并且已经为此做了几个小时。我的named.conf中有这个,我仍然看到相同的结果。内部调用被馈送,但任何外部(在区域控制域中)都被转储。任何帮助都会很棒!此外,这是我正在使用的 Ubuntu 9.04 操作系统。
Code removed because it was wrong.
Run Code Online (Sandbox Code Playgroud)
正确的方法——在问题结束后添加
好吧,多亏了 serverfault 上的人,我现在可以在我的服务器上以更简洁的方式完美地运行它。这是你如何做到的。从 bind9 的基本安装编辑您的 named.conf.local 文件并为您要重定向的每个子域添加一个区域:
/etc/bind/named.conf
// WEBDOMAIN.COM ENTRIES
zone "test.webdomain.com" {
type master;
file "/etc/bind/zones/test.webdomain.com";
};
zone "alpha.webdomain.com" {
type master;
file "/etc/bind/zones/alpha.webdomain.com";
};
zone "beta.webdomain.com" {
type master;
file "/etc/bind/zones/beta.webdomain.com";
};
// INTERNETSITE.COM ENTRIES
zone "internal.internetsite.com" {
type master;
file "/etc/bind/zones/internal.internetsite.com";
};
zone "dev.internetsite.com" {
type master;
file "/etc/bind/zones/dev.internetsite.com";
};
Run Code Online (Sandbox Code Playgroud)
编辑您的 /etc/bind/named.conf.options 文件并将您想要使用的任何转发器添加到正确的位置:
/etc/bind/named.conf.options
options {
directory "/var/cache/bind";
forwarders {
208.67.222.222;
208.67.220.220;
8.8.8.8;
8.8.4.4;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
Run Code Online (Sandbox Code Playgroud)
在 /etc/bind/zones/ 创建一个名为区域的新文件夹,并为您在上面创建的与上面的“文件”属性匹配的每个区域添加一个新文件。以 test.webdomain.com 为例:
/etc/bind/zones/test.webdomain.com
$TTL 604800
@ IN SOA test.webdomain.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS test.webdomain.com.
test.webdomain.com. IN A 10.0.1.20
Run Code Online (Sandbox Code Playgroud)
其中 10.0.1.20 是您希望此(子)域转发到的 A 记录 IP 地址。通过这样做,test.webdomain.com 的记录仅对子域具有权威性,而全球 DNS 将像往常一样提供任何其他子域或根域。
您要做的是在您的内部 DNS 服务器上为 testing.webdomain.com 创建一个 DNS 区域。这样 webdomain.com DNS 不是由您的内部服务器托管,而是由 dotster 托管。
当有人查询 www.webdomain.com 时,请求将被转发到 dotster 进行查找(因为您的本地 DNS 服务器对该区域没有权威性),而 testing.webdomain.com 的请求将由您的内部 DNS 服务器处理.
您需要拆分视图 DNS。对于您的边界机器,请使用外部解析器。对于您的测试环境,请使用单独的内部解析器。内部解析器将在 DNS 中包含您的测试条目并从一个视图中获取答案;但是外部世界会看到您的区域的不同“视图”,忽略了测试环境。
其他可能感兴趣的 SF 条目:
我今天只有时间浏览你的扩展帖子,所以这是第一眼:
options {
directory "/etc/bind";
listen-on { // why are these lines needed?
10.0.1.5; // the way it is set up, only your loopback
127.0.0.1; // and your LAN clients will be able to
// get answers; the outside world can't see boo
// because there's no interface/port pair
// to contact. I would just get rid of this and
}; // not worry about what interfaces are being bound to
// BTW, that listen-on line is why your outside queries are failing.
auth-nxdomain no;
allow-query { any; };
recursion no;
version "0";
};
Run Code Online (Sandbox Code Playgroud)
此外,外部 match-clients 语句
view "external" {
match-clients { !localnets; any; };
Run Code Online (Sandbox Code Playgroud)
可以做成
view "external" {
match-clients { any; };
Run Code Online (Sandbox Code Playgroud)
因为当您添加到 match-clients 时,它已经假设开始时没有任何匹配项;否定 ACL 确实不会增加太多(因为它在该视图中从未“存在”过,因此没有理由将其取消)。
我敢肯定,我可能错过了一些事情,但这些是最明显的罪魁祸首。
| 归档时间: |
|
| 查看次数: |
20135 次 |
| 最近记录: |