多区域dns
主配置文件 ----区域更改 地址库文件更改
地址库文件------ 域名 主机名称 ip地址
[root@localhost ~]# vim /etc/named.conf
options {
directory "/var/named";
};
zone "sina.com" IN {
type master;
file "s.txt";
};
zone "qq.com" IN {
type master;
file "q.txt";
};
[root@localhost ~]# cd /var/named
[root@localhost named]# cp -p s.txt q.txt
[root@localhost named]# vim q.txt
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
qq.com. NS nihao
nihao A 192.168.4.6
hhh A 3.3.3.3
xxx A 4.4.4.4
[root@localhost named]# cd
[root@localhost ~]# systemctl restart named
客户端测试
[root@localhost ~]# nslookup hhh.qq.com
Server: 192.168.4.6
Address: 192.168.4.6#53
Name: hhh.qq.com
Address: 3.3.3.3
[root@localhost ~]# nslookup xxx.qq.com
Server: 192.168.4.6
Address: 192.168.4.6#53
Name: xxx.qq.com
Address: 4.4.4.4