操作篇:



DNS服务器主从同步:

首先同步时间:

CentOS7 DNS主从同步主从都要关闭

在主域名服务器上:(192.168.80.181)

yum install ntp -y

vi /etc/ntp.conf

加入以下三行在指定的位置

restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0
fudge 127.127.1.0 stratum 8

CentOS7 DNS主从同步


启动服务

service ntpd start
systemctl enable ntpd


在从域名服务器上:192.168.80.182

yum install ntp  -y

ntpdate  192.168.80.181   //用从的去同步主服务器的时间

CentOS7 DNS主从同步


主:CentOS7 DNS主从同步

从:CentOS7 DNS主从同步


搭建主从同步:

在主域名服务器上:

vi /etc/named.conf

修改以下内容:
listen-on port 53 { any; };
allow-query     { any; };


vi /etc/named.rfc1912.zones

在最下面添加以下内容

zone "hello.com" IN {
        type master;
        file "hello.com.zone";
        allow-update { 192.168.80.101; };
        also-notify { 192.168.80.101; };
};

zone "80.168.192.in-addr.arpa" IN {
        type master;
        file "hello.com.local";
        allow-update { 192.168.80.101; };
        also-notify { 192.168.80.101; };
};

CentOS7 DNS主从同步

CentOS7 DNS主从同步

cd /var/named/

cp -p named.localhost hello.com.zone

vi hello.com.zone

CentOS7 DNS主从同步

cp -p hello.com.zone hello.com.local

vi hello.com.local

CentOS7 DNS主从同步

systemctl start named //启动dns服务

CentOS7 DNS主从同步

.

在从域名服务器上:

yum install bind -y

vi /etc/named.conf 

listen-on port 53 { any; };
allow-query     { any; };

vi /etc/named.rfc1912.zones

zone "hello.com" IN {
        type slave;
        masters { 192.168.80.181; };
        file "slaves/hello.com.zone";
};
zone "80.168.192.in-addr.arpa" IN {
        type slave;
        masters { 192.168.80.181; };
        file "slaves/hello.com.local";
};

CentOS7 DNS主从同步

然后启动服务

CentOS7 DNS主从同步

CentOS7 DNS主从同步

这里出现了乱码

解决方法:

vi  /etc/named.conf
masterfile-format text ;

CentOS7 DNS主从同步


CentOS7 DNS主从同步


转载于:https://blog.51cto.com/14188767/2348998

相关文章:

  • 2022-12-23
  • 2021-05-15
  • 2021-07-10
  • 2019-09-05
  • 2022-01-08
  • 2021-09-17
  • 2022-01-07
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2021-12-22
  • 2021-06-22
  • 2021-09-25
  • 2021-11-05
相关资源
相似解决方案