[root@rhel Server]# cd ~
[root@rhel ~]# vi /var/named/chroot/etc/named.caching-nameserver.conf
listen-on port 53 { 192.168.100.101; }; //修改一下IP地址。
allow-query { any; }; //允许所有人查询。
match-clients { any; }; //允许所有客户端。
match-destinations { any; }; //允许所有目标。
创建区域:
[root@rhel ~]# vi /var/named/chroot/etc/named.rfc1912.zones
添加以下区域:
zone "rhel1.com" IN {
type master;
file "rhel1.com.zone";
allow-update { none; };
};
zone "rhel2.com" IN {
type master;
file "rhel2.com.zone";
allow-update { none; };
};
修改区域配置文件;
[root@rhel ~]# cd /var/named/chroot/var/named/
[root@rhel named]# cp -p localhost.zone rhel1.com.zone //别忘了加-p。
[root@rhel named]# cp -p localhost.zone rhel2.com.zone
[root@rhel named]# vi rhel1.com.zone
www IN A 192.168.100.101 //添加这一行
[root@rhel named]# vi rhel2.com.zone
www IN A 192.168.100.101 //也是添加这一行
配置完成,重启一下服务。
[root@rhel named]# service named restart