dns主从服务器的设置
主从dns服务器上都要:关闭防火墙:
# systemctl stop firewalld
# setenforce 0
挂载和下载bind
# mount /dev/sr0 /mnt
# dnf install bind -y
主服务器设置:
# vim /etc/named.conf
options {
listen-on port 53 { 192.168.115.100; };//把IP改为自己的IP
directory "/var/named";
allow-query { any; }; //答应那些主机向我发起查询,any(所以主机)
allow-transfer { 192.168.115.133; }; //答应共享资源文件
};
zone "openlab.com" IN {
type master;
file "named.openlab.com";
};
zone "115.168.192.in-addr.arpa" IN {
type master;
file "named.192";
allow-update { none; };
};
# vim /var/named/named.openlab.com
$TTL 1D
@ IN SOA @ 15380914067.163.com (
2024103001
1M
2M
5M
1M
)
IN NS ns.openlab.com.
ns IN A 192.168.115.100
www IN A 192.168.115.133
wwww IN CNAME www
注:如果资源记载文件是通过/var/named/named.localhost模版拷贝修改
方法一:cp -a /var/named/named.localhost /var/named/named.xxxx
方法二:cp /var/named/named.localhost /var/named/named.xxxx
chmod o+r /var/named/named.xxxx
资源记载文件是通过/var/named/named.localhost模版拷贝修改
#cp /var/named/named.localhost /var/named/named.192
#chmod o+r /var/named/named.192//给与写权限
# vim /var/named/named.192
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns.openlab.com.
133 PTR www.openlab.com.
100 PTR ns.openlab.com.
# systemctl restart named
从dns服务器(资源文件的备份)
# vim /etc/named.conf
options {
listen-on port 53 { 192.168.115.133; };
directory "/var/named/slaves";
allow-query { any; };
};
zone "openlab.com" IN { //正向剖析域
type slave; //slave
file "named.openlab.com"; //正向剖析的资源记载文件(数据文件)
masters { 192.168.115.100; };//主dns服务器
};
zone "115.168.192.in-addr.arpa" IN { //网络位地址倒序表示
type slave;
file "named.192";
masters { 192.168.115.100; };
};
# systemctl restart named
# watch ls -l /var/named/slaves/
//查看资源文件传输情况
https://i-blog.csdnimg.cn/direct/33775db299244ebda9efde8087448c06.png
在客户端进行正反向剖析
# nslookup
> server 192.168.115.100
Default server: 192.168.115.100
Address: 192.168.115.100#53
> www.openlab.com
Server: 192.168.115.100
Address: 192.168.115.100#53
Name: www.openlab.com
Address: 192.168.115.133
> 192.168.115.133
133.115.168.192.in-addr.arpa name = www.openlab.com.
>
https://i-blog.csdnimg.cn/direct/ede6278bebd24cc6af81bd4b3a9e5311.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]