$TTL 3h
test.com. IN SOA mytest.test.com. root.mytest.test.com. (
1;
3h;
1h;
1w;
1h)
test.com. IN NS mytest.test.com.
mytest.test.com. IN A 192.168.0.2
gateway.test.com. IN A 192.168.0.1
ftp.test.com. IN CNAME gateway.test.com.
web.test.com. IN A 192.168.0.2
[/PHP]
现在我们讨论下zone文件,在最上面我加了个TTL参数,这个参数的用处是这个意思,资料上说在bind8.2前soa的最后项是表示默认的ttl值
域传输的时候根据这个序列号来更新的,其他是几个定时器。
test.com. IN NS mytest.test.com. 说明test.com.里的名字服务器是哪个
mytest.test.com. IN A 192.168.0.2 这个a记录表示mytest.test.com.的ip地址多少
ftp.test.com. IN CNAME gateway.test.com. cname记录我反正理解为别名吧
[PHP]
/var/named/db.192.168.0
$TTL 3h
0.168.192.in-addr-arpa. IN SOA mytest.test.com. root.mytest.test.com. (
1;
3h;
1h;
1w;
1h)
0.168.192.in-addr-arpa. IN NS mytest.test.com.
1.0.168.192.in-addr.arpa. in PTR mytest.test.com.
2.0.168.192.in-addr.arpa. in PTR gateway.test.com.
[/PHP]
这个反向解析也和上面的基本类似,就是用了PTR记录而已。
本人水平有限,所以不排除有发生错误的可能,如果那位发现请多多指正。由于事情很多,所以不可能一下全把相关实验做了,在以后还会继续把其他实验结果贴出来供大家参考。
晚些时候把实验的截图发出来给大家验证。
$TTL 3h
test.com. IN SOA mytest.test.com. root.mytest.test.com. (
1;
3h;
1h;
1w;
1h)
test.com. IN NS mytest.test.com.
mytest.test.com. IN A 192.168.0.2
mytest.test.com. IN A 192.168.100.2
gateway.test.com. IN A 192.168.0.1
ftp.test.com. IN CNAME gateway.test.com.
web.test.com. IN A 192.168.0.2
[/php]
如果是两个网络的那么最好产生的情况是dns解析的ip地址是本地网络的,也就是说192.168.100.0的网络解析的地址是100.1,而192.168.0.0解析的是0.1。
那么怎么办?我们可以设置下/etc/resolv.conf文件
resolv文件有参数叫sortlist,字面意思就很清楚是排序
格式为sortlist 网络号/ 掩码 网络号/ 掩码 。。。。最多是到10个网络号
然后开始用ping 测试,请看图
结果是丢包,这是正确结果。因为根本就没有这个地址
然后我把sortlist的列表改了下
然后结果也变了