配置dns主从服务器,解析qq.com域下的所有主机,www.qq.com aaa.qq.com bbb.qq.com .....
主从服务器都安装好bind软件包并关闭防火墙 、selinux
主服务器
主配置文件
vim /etc/named.conf
options {
listen-on port 53 { 192.168.226.200; };
directory "/var/named";
allow-transfer { 192.168.226.129; };
};
zone "qq.com" IN {
type master;
file "named.qq.com";
};
配置named.qq.com文件
vim /var/named/named.qq.com
$TTL 1D
@ IN SOA @ admin.admin.com. (
2021071401
1D
1H
1W
3H )
IN NS dns.qq.com.
dns IN A 192.168.226.200
www IN A 192.168.226.111
aaa IN A 192.168.226.222
bbb IN A 192.168.226.101
重启服务
从服务器
主配置文件
vim /etc/named.conf
options {
listen-on port 53 { 192.168.226.129; };
directory "/var/named";
};
zone "qq.com" IN {
type slave;
file "named.qq.com";
master { 192.168.226.200; };
};
重启服务