zoukankan      html  css  js  c++  java
  • DNS--主从

    操作系统:centos7.8

    DNS-master:192.168.198.128

    DNS-slave:192.168.198.129

    一 主从同步过程

     master修改完成重启后 将传送notify给所有slave

     slave将查询master的SOA记录

     master收到请求后将SOA记录发送给slave

     slave收到后同时对比查询结果中的serial值,大于将发送zone transfer请求,不大于将结束数据同步过程

     master响应zone transfer请求并传送结果,直到整个slave更新完成

    二 主DNS配置

     1 主配置文件

    [root@localhost ~]# vim /etc/named.conf
    ...
    zone "xinenhui.com" IN {
            type master;
            file "xinenhui.com.DNS1.zone";
            notify yes;
            also-notify { 192.168.198.129; };
            allow-transfer { 192.168.198.129; };  #允许谁复制数据
    };

     2 修改zone文件 重启服务

    [root@localhost ~]# cat /var/named/xinenhui.com.DNS1.zone 
    $TTL 3H
    @       IN SOA  @ rname.invalid. (
                                            2020120620      ; serial
                                            1D      ; refresh
                                            1H      ; retry
                                            1W      ; expire
                                            3H )    ; minimum
            NS      dns.xinenhui.com.
    dns     A       6.6.6.10
    www     A       1.1.1.5
    [root@localhost ~]# systemctl restart named

    三 从DNS配置

    [root@localhost ~]# vim /etc/named.conf
    ...
    zone "xinenhui.com" IN {
            type slave;
            masters { 192.168.198.128; };    #master IP
            file "xinenhui.com.DNS1.zone";    #指定就行,不用创建
    };
    [root@localhost ~]# systemctl start named

     启动服务后会发现在 /var/named/ 下多了个 xinenhui.com.DNS1.zone 文件

    四 在从DNS上测试

    五 修改主DNS的zone文件 再进行测试

    [root@localhost ~]# cat /var/named/xinenhui.com.DNS1.zone 
    $TTL 3H
    @       IN SOA  @ rname.invalid. (
                                            2020120621      ; serial    #修改数值大于之前的即可
                                            1D      ; refresh
                                            1H      ; retry
                                            1W      ; expire
                                            3H )    ; minimum
            NS      dns.xinenhui.com.
    dns     A       6.6.6.15                            #修改ip
    www     A       1.1.1.5
    [root@localhost ~]# systemctl restart named

  • 相关阅读:
    scrapy中selenium的应用
    Django的锁和事务
    redis
    【leetcode】187. Repeated DNA Sequences
    【leetcode】688. Knight Probability in Chessboard
    【leetcode】576. Out of Boundary Paths
    【leetcode】947. Most Stones Removed with Same Row or Column
    【leetcode】948. Bag of Tokens
    【leetcode】946. Validate Stack Sequences
    【leetcode】945. Minimum Increment to Make Array Unique
  • 原文地址:https://www.cnblogs.com/Xinenhui/p/14093144.html
Copyright © 2011-2022 走看看