Linux下DNS服务器的搭建及区域委派
2012-08-22 11:34:49 来源:WEB开发网核心提示:[root@www ~]# cd /var/named/chroot/etc[root@www etc]# vim named.conf无条件转发:forwarders {空格ip ; 空格};[root@www etc]# nslookup www.gjp.comServer: 192.168.2.12Address
[root@www ~]# cd /var/named/chroot/etc
[root@www etc]# vim named.conf
无条件转发:forwarders {空格ip ; 空格};
[root@www etc]# nslookup www.gjp.com
Server: 192.168.2.12
Address: 192.168.2.12#53
Non-authoritative answer:
Name: www.gjp.com
Address: 192.168.2.100
[root@www etc]# nslookup www.bj.gjp.com
Server: 192.168.2.12
Address: 192.168.2.12#53
Non-authoritative answer:
Name: www.bj.gjp.com
Address: 192.168.3.100
有条件转发:
[root@www etc]# pwd
/var/named/chroot/etc
先删除上面的无条件转发:forwarders{ }
[root@www etc]# vim named.rfc1912.zones
增加如下信息:
26 zone "gjp.com" IN {
27 type forward;
28 forwarders { 192.168.2.100; };
29 };
[root@www etc]# rndc reload
server reload successful
[root@www etc]# rndc flush
[root@www etc]# nslookup www.gjp.com
Server: 192.168.2.12
Address: 192.168.2.12#53
Non-authoritative answer:
Name: www.gjp.com
Address: 192.168.2.100
[root@www etc]# nslookup www.bj.gjp.com
Server: 192.168.2.12
Address: 192.168.2.12#53
Non-authoritative answer:
Name: www.bj.gjp.com
Address: 192.168.3.100
四、用一台XP系统测试:
更多精彩
赞助商链接