实验设备
? 主服务器:OpenElur Linux? IP地址为192.168.188.129
? 从服务器:RedHat Linux? IP地址为192.168.188.128
实验步骤
1.进行主服务器的基础配置
#安装DNS对应工具
[root@localhost ~]# yum install bind -y
#编辑DNS系统配置信息
[root@localhost ~]# vim /etc/named.conf
options {?
listen-on port 53 { 192.168.188.129; };
directory?????? "/var/named";
allow-transfer { 192.168.188.128; };? ? #从服务器地址
};
#正解析区域
zone "RRR.com" IN {
? ? ? ? type master;
? ? ? ? file "RRR";
};
#反解析区域
)
zone "168.188.192.in-addr.arpa" IN {? ? ? ? ?
? ? ? ? type master;
? ? ? ? file "named.192.168.188";
};
?2.配置主服务器的`解析配置文件
#编辑正向解析配置文件
[root@localhost ~]# vim /var/named/RRR
$TTL 1D
@?????? IN? SOA . admin.admin.com. ( 2024011700 1D 1H 3H 1D )
?????? ?IN?? NS?? dns.RRR.com.
dns???? IN?? A??? 192.168.188.129
www? IN?? A??? 192.168.188.111
ftp???? IN?? A??? 192.168.188.123
a???? ??IN?? A??? 192.168.188.100
aaa???? IN? CNAME? a
#重启服务
[root@localhost ~]# systemct restart named
3.进行从服务器的基础配置?
#安装DNS对应工具
[root@localhost ~]# yum install bind -y
#编辑DNS系统配置文件
[root@localhost ~]# vim /etc/named.conf
options {?
listen-on port 53 { 192.168.188.129; };
directory?????? "/var/named";
};
zone "RRR.com" IN {?????????????????
??????? type slave;?????????????
??????? file "slaves/named.RRR.com";
??????? masters {192.168.188.129;};
};?
#重启服务
[root@localhost ~]# systemct restart named
?4.实验结果检验
[root@localhost ~]# nslookup
>server 192.168.188.129
> 192.168.188.100
100.168.168.192.in-addr.arpa??? name = a.RRR.com.
> a.RRR.com
Server: 192.168.188.100
Address: 192.168.188.100#53