dns服务器配置
主服务器
1.挂载点 mount /dev/sr0 /mnt
2.防火墙关闭 systemctl stop firewalld
setenforce 0
3.下载bind软件 dnf install bind -y
4.进行正向解析配置 vim /etc/named.conf
options {
listen-on port 53 { 192.168.92.128; };
directory "/var/named";
allow-query { any; };
allow-transfer { 192.168.92.129;};
};
zone "openlab.com" IN {
type master;
file "named.openlab.com";};
zone "92.168.192.in-addr.arpa" IN {
type master;
file "named.172";
allow-update { none; };
};
5.进行反向解析配置 vim /var/named/named.openlab.com
$TTL 1D
@ IN SOA @ luiweixin.qq.com (
2024103001
1H
2H
1H
1H )
IN NS ns.openlab.com.
ns IN A 192.168.92.128www IN A 192.168.92.130
wwww IN CNAME www
vim /var/named/named.172
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns.openlab.com.
129 PTR ns.openlab.com.
131 PTR www.openlab.com
6.测试是否成功
从服务器
1..挂载点 mount /dev/sr0 /mnt
2.防火墙关闭 systemctl stop firewalld
setenforce 0
3.下载bind软件 dnf install bind -y
4.配置从服务器 vim /etc/named.conf
options {
listen-on port 53 { 192.168.92.129; };
directory "/var/named";
allow-query { any; };
};
zone "openlab.com" IN {
type slave;
file "named.openlab.com";
masters { 192.168.92.128; };
};
zone "92.168.192.in-addr.arpa" IN {
type slave;
file "named.172";
masters { 192.168.92.128; };
};
5.重启服务器 systemctl restart named
6.从服务器监听数据 tail -f /var/log/messages
7.主服务器监听数据 tail -f /var/log/messages