一个VirtualBox服务器中的DNS域和子域名?

我的任务是由我的导师负责设置DNS服务器。 但是我真的不知道我是否正确地做了这件事。 我无法parsing/ ping / nslookup名称服务器。 系统日志sais的ns1是跛脚的。 🙁

我正在使用VirtualBox的四个Ubuntu客户端,其中一个被configuration为DNS服务器。 我build立了一个桥接的虚拟networking,所有的主机都能ping通对方。 我在DNSconfiguration中使用这些IP地址。 一切似乎都没问题,但即使它应该是主DNS,我也无法到达ns1.example.com。

任务:使用域和子域设置DNS服务器。 主域:域,子域的SOA,NS,子域的粘连logging和Alogging。 子域:SOA,NS,胶水和Alogging。 还应该有邮件和wwwlogging。

请告诉我我的错误在这里。 我不断阅读新的东西,并改变configuration,但我永远不能到达nslookup适用于所有地址的点,除非我删除子域并添加sub.domain.com作为一个简单的Alogging,但不会削减它。 :P

named.conf.local

zone "domain.com" { type master; file "/etc/bind/zones/domain.com.db"; }; zone "sub.domain.com" { type master; file "/etc/bind/zones/sub.domain.com.db"; }; zone "0.168.192.in-addr.arpa" { type master; file "/etc/bind/zones/0.168.192.in-addr.arpa"; }; 

domain.com.db

 $TTL 3D; TTL default, 3 dagar domain.com. IN SOA ns1.domain.com. admin.domain.com. ( 2012122104; Serialnumber 28800; 3600; 604800; 38400 ) ; Maindomain name servers domain.com. IN NS ns1.domain.com. sub.domain.com. IN NS ns2.sub.domain.com. ; Main domain A records ns1.domain.com. IN A 192.168.1.92 ns2.sub.domain.com. IN A 192.168.1.84 

sub.domain.com.db

 $TTL 3D $ORIGIN sub.domain.com. @ IN SOA ns2.sub.domain.com. admin.sub.domain.com. ( 2012122104; Serialnumber 28800; 3600; 604800; 38400 ) ; Sub-domain IN NS ns2.sub.domain.com. domain.com. IN NS ns1.domain.com. ; Mailserver for subdomain IN MX 10 mail.sub.domain.com. ; A records for subdomain ns2 IN A 192.168.1.84 ns1.domain.com. IN A 192.168.1.92 ; Glue records for subdomain mail IN A 192.168.1.89 www IN A 192.168.1.72 ; Canonical names for subdomain stuff IN CNAME www 

in-addr.arpa

 $TTL 3D @ IN SOA ns1.domain.com. admin.domain.com. ( 2012122103; 28800; 604800; 604800; 86400 ); IN NS ns1.domain.com. IN NS ns2.sub.domain.com. 92 IN PTR ns1.domain.com. 92 IN PTR ns2.sub.domain.com. 74 IN PTR www.sub.domain.com. 89 IN PTR mail.sub.domain.com. 

节日快乐! ;>

编辑:我已经把它分成一个文件,使用ORIGIN $,我可以达到ns1,但没有任何潜艇…

我维护一个名称服务器,但有几个子域,所以我使用这里引用的O'Reilly DNS&Bind书中提到的$ ORIGIN技巧。

/var/named/chroot/var/named/data/db.192.168.1

 $ORIGIN . $TTL 604800 ; 1 week 1.168.192.in-addr.arpa IN SOA ns.me.local. hostmaster.me.local. ( 2000075001 ; serial 28800 ; refresh (8 hours) 7200 ; retry (2 hours) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS ns.me.local. $ORIGIN 1.168.192.in-addr.arpa. 1 PTR mulder.me.local. 101 PTR flanders.me.local. 102 PTR lisa.me.local. .... .... 

/var/named/chroot/var/named/data/db.me.local

 $ORIGIN . $TTL 604800 ; 1 week me.local IN SOA ns.me.local. hostmaster.me.local. ( 2000075000 ; serial 28800 ; refresh (8 hours) 7200 ; retry (2 hours) 3600000 ; expire (5 weeks 6 days 16 hours) 86400 ; minimum (1 day) ) NS ns.me.local. A 192.168.1.1 MX 10 mail.me.local. MX 20 me.local. TXT "v=spf1 mx/24 ~all" $ORIGIN me.local. apu A 192.168.1.112 HINFO "VZ12" "VZ12" MX 10 mail TXT "v=spf1 redirect=me.local" bart A 192.168.1.103 HINFO "VZ3" "VZ3" MX 10 mail TXT "v=spf1 redirect=me.local" ... ... $INCLUDE "data/subdomain-somedom1.org.sub" $INCLUDE "data/subdomain-somedom2.org.sub" 

/var/named/chroot/var/named/data/subdomain-somedom1.org.sub

 $ORIGIN somedom1.org.me.local. blogs CNAME blogs.me.local. 

/var/named/chroot/var/named/data/subdomain-somedom2.org.sub

 $ORIGIN somedom2.org.me.local. bender CNAME bender.me.local. farnsworth CNAME farnsworth.me.local. fry CNAME fry.me.local. leela CNAME leela.me.local.