好吧,我要预先声明这个问题对于这个媒体来说可能过于复杂(细节量而不是复杂性)。但我认为这是最好的起点。
我正在尝试建立一个概念验证项目,而我的 BIND 配置是我的第一个大障碍。我想在 3 个物理盒子上设置 3 个 DNS 服务器。 这些盒子都不需要解析公共地址,这只是内部的。我已经阅读了(主要是)优秀的 DNS & BIND 第 5 版书中如何设置内部根。但是我对他们示例的翻译不起作用。所有 IP 都是 RFC 1918 不可路由的。
框 1 对box1.bogus域中的地址具有权威性,框 2 对box2.bogus域中的地址具有权威性。框 3 将作为域bogus的内部根和 TLD 服务器。
当前未解决的问题:
我在框 1 和框 2 上有一个提示文件,其中包含根区域的 NS 定义的单个NS记录。此外,还有一条A记录将 NS 转换为根的 ip。如果我
dig .
从框 1 中得到一个带有 NS 名称的权限部分,而不是答案和附加记录部分。因此,我无法从框 1 中实际解析根服务器的 IP。如果我将我
/etc/resolv.conf
的 from box 1 直接指向根服务器并执行 a,dig box1.bogus
我将获得 ns.box1.bogus答案记录和附加部分中的翻译。但是在下一次迭代中(什么时候应该得到 A 记录)我得到dig: couldn't get address for ns.box1.bogus
显然我的配置不正确。我看不到将它们附加到此帖子的方法,因此,如果人们想逐步完成此操作,我会将它们剪切'n'粘贴到此问题的评论中。否则,我愿意与“DNS 人员”一起“离线”,以找出我缺少“。”的地方。或者有太多!
我个人认为网络可以使用另一个不使用 Movie-U 示例的内部根示例。
好的,如果我们要这样做,那么我们应该使用一个具体的例子吧?我在专用 VLAN 上设置了 3 台机器来进行测试。作为健全性检查,我将所有相关配置配对,在可能的情况下进行压缩,并重新部署 2 个名称服务器。我暂时忽略了 Scratchy。结果与上述相同。这是配置和初始挖掘输出。
虚假
Machine Name: Bogus (I just realized I should change this...)
Role: Internal Root and TLD Nameserver
IP: 10.0.0.1
BIND: 9.5.0-16.a6.fc8
/etc/named.conf
// Controls who can make queries of this DNS server. Currently only the
// local test bed. When there is a standardized IP addr scheme, we can have
// those addr ranges enabled so that even if firewall rules get broken, the
// public internet can't query the internal DNS.
//
acl "authorized" {
localhost; // localhost
10.0.0.0/24; // Local Test
};
options {
listen-on port 53 {
127.0.0.1;
10.0.0.1;
};
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
pid-file "/var/run/named/named.pid";
allow-query { any; };
recursion no;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// The fake root.
//
zone "." {
type master;
file "master/root";
allow-query { authorized; };
};
//
// The TLD for testing
//
zone "bogus" {
type master;
file "master/bogus";
allow-query { authorized; };
allow-transfer { authorized; };
};
/var/named/master/root
$TTL 3600
. SOA ns.bogustld. hostmaster.internal.bogus. (
2008101601 ; serial
1H ; refresh
2H ; retry
14D ; expire
5M ) ; minimum
;
; Fake root zone servers defined.
;
. NS ns.bogustld.
ns.bogustld. A 10.0.0.1
;
; Testing TLD
;
bogus NS ns1.bogus.
ns1.bogus. A 10.0.0.1
/var/named/master/bogus
$TTL 3600
@ SOA ns1.internal.bogus. hostmaster.internal.bogus. (
2008102201 ; serial date +seq
1H ; refresh
2H ; retry
14D ; expire
5M) ; min TTL
;
NS ns1.internal.bogus.
;
; Auth servers
;
ns1.internal.bogus. A 10.0.0.1
;
; Customer delegations each customer 2nd level domain has it's
; own zone file.
;
;Modified to be unique nameservers in the bogus domain
itchy NS ns1-itchy.bogus.
ns1-itchy.bogus. A 10.0.0.2
;
scratchy NS ns1-scratchy.bogus.
ns1-scratchy.bogus. A 10.0.0.3
来自 dig 的输出。
; <<>> DiG 9.5.0-P2 <<>> .
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57175
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;. IN A
;; AUTHORITY SECTION:
. 300 IN SOA ns.bogustld. hostmaster.internal
.bogus. 2008101601 3600 7200 1209600 300
;; Query time: 1 msec
;; SERVER: 10.0.0.1#53(10.0.0.1)
;; WHEN: Tue Oct 21 12:23:59 2008
;; MSG SIZE rcvd: 88
dig +trace itchy.bogus 的输出
; <<>> DiG 9.5.0-P2 <<>> +trace itchy.bogus
;; global options: printcmd
. 3600 IN NS ns.bogustld.
;; Received 57 bytes from 10.0.0.1#53(10.0.0.1) in 1 ms
itchy.bogus. 3600 IN NS ns1-itchy.bogus.
;; Received 69 bytes from 10.0.0.1#53(ns.bogustld) in 0 ms
itchy.bogus. 3600 IN A 10.0.0.2
itchy.bogus. 3600 IN NS ns1.itchy.bogus.
;; Received 79 bytes from 10.0.0.2#53(ns1-itchy.bogus) in 0 ms
发痒
Machine Name: Itchy
Role: SLD Nameserver (supposed to be owner of itchy.bogus)
IP: 10.0.0.2
BIND: 9.5.0-16.a6.fc8
/etc/named.conf
// Controls who can make queries of this DNS server. Currently only the
// local test bed. When there is a standardized IP addr scheme, we can have
// those addr ranges enabled so that even if firewall rules get broken, the
// public internet can't query the internal DNS.
//
acl "authorized" {
localhost; // localhost
10.0.0.0/24; // LAN Test
};
options {
listen-on port 53 {
127.0.0.1;
10.0.0.2;
};
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
pid-file "/var/run/named/named.pid";
allow-query { any; };
recursion no;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "master/root.hint";
};
zone "itchy.bogus" {
type master;
file "master/itchy.bogus";
allow-query { authorized; };
allow-transfer { authorized; };
};
/var/named/master/itchy.bogus
$TTL 3600
@ SOA ns1.itchy.bogus. hostmaster.itchy.bogus. (
2008102202 ; serial
1H ; refresh
2H ; retry
14D ; expire
5M ) ; minimum
;
A 10.0.0.2
NS ns1.itchy.bogus.
ns1 A 10.0.0.2
/var/named/master/root.hint
. 3600000 NS ns.bogustld.
ns.bogustld. 3600000 A 10.0.0.1
; End of File
/etc/resolv.conf
nameserver 10.0.0.2
来自 dig 的输出。
; <<>> DiG 9.5.0-P2 <<>> .
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31291
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;. IN A
;; AUTHORITY SECTION:
. 3600000 IN NS ns.bogustld.
;; Query time: 0 msec
;; SERVER: 10.0.0.2#53(10.0.0.2)
;; WHEN: Tue Oct 21 17:09:53 2008
;; MSG SIZE rcvd: 41
dig + trace itchy.bogus 的输出
; <<>> DiG 9.5.0-P2 <<>> +trace itchy.bogus
;; global options: printcmd
. 3600000 IN NS ns.bogustld.
;; Received 41 bytes from 10.0.0.2#53(10.0.0.2) in 0 ms
dig: couldn't get address for 'ns.bogustld': failure