所有服务器:
iptables -F
systemctl stop firewalld
setenforce 0
配置yum
主服务器:
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.200.111
nameserver 192.168.200.112
[root@localhost ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost6.localdomain6
192.168.200.111ns1.crushlinux.com
192.168.200.112ns2.crushlinux.com
[root@localhost ~]# vim /etc/named.conf
options {
directory "/var/named";
};
zone "crushlinux.com" IN {
type master;
file "crushlinux.zheng";
allow-transfer { 192.168.200.112; };
};
zone "200.168.192.in-addr.arpa" IN {
type master;
file "crushlinux.fan";
allow-transfer { 192.168.200.112; };
};
[root@localhost ~]# vim /var/named/crushlinux.zheng
$TTL 86400
@INSOAcrushlinux.com.
admin.crushlinux.com. (
20190817
3H
15M
1W
1D
)
INNSns1.crushlinux.com.
INNSns2.crushlinux.com.
INMX 10mail.crushlinux.com.
ns1INA192.168.200.111
ns2INA192.168.200.112
mailINA192.168.200.113
wwwINA192.168.200.114
studyINA192.168.200.115
*INA192.168.200.111
ftpINCNAMEwww
[root@localhost ~]# vim /var/named/crushlinux.fan
$TTL 86400
@INSOAcrushlinux.com.
admin.crushlinux.com. (
20190817
3H
15M
1W
1D
)
INNSns1.crushlinux.com.
INNSns2.crushlinux.com.
INMX 10mail.crushlinux.com.
111INPTRns1.crushlinux.com.
112INPTR
ns2.crushlinux.com.
113INPTRmail.crushlinux.com.
114INPTRwww.crushlinux.com.
115INPTRstudy.crushlinux.com.
111INPTRns1.crushlinux.com.
[root@localhost ~]# chown :named /var/named/crushlinux.*
[root@localhost ~]# named-checkconf -z /etc/named.conf
[root@localhost ~]# named-checkzone crushlinux.com
/var/named/crushlinux.zheng
[root@localhost ~]# named-checkzone crushlinux.com
/var/named/crushlinux.fan
[root@localhost ~]# systemctl restart named
===================================================
从服务器:
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.200.111
nameserver 192.168.200.112
[root@localhost ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost6.localdomain6
192.168.200.111ns1.crushlinux.com
192.168.200.112ns2.crushlinux.com
[root@localhost ~]# vim /etc/named.conf
options {
directory "/var/named";
};
zone "crushlinux.com" IN {
type slave;
file "slaves/crushlinux.zheng";
masters { 192.168.200.111; };
};
zone "200.168.192.in-addr.arpa" IN {
type slave;
file "slaves/crushlinux.fan";
masters { 192.168.200.111; };
};
[root@localhost ~]# systemctl restart named