zoukankan      html  css  js  c++  java
  • bind主从配置非DLZ

     
    1. 编译安装bind
    ./configure --prefix=/usr/local/bind --enable-threads --disable-openssl-version-check  && make && make install
     
    2. 主节点生成key并scp至从节点
    /usr/local/bind/sbin/rndc-confgen -s 127.0.0.1 -r /dev/urandom > rndc.conf
     
    echo "aaa" > aaa
    echo "bbb" > bbb 
    /usr/local/bind/sbin/rndc-confgen -a -b -r aaa 128 -c /usr/local/bind/etc/b.key -k b
    /usr/local/bind/sbin/rndc-confgen -a -b -r bbb 128 -c /usr/local/bind/etc/a.key -k b
    scp a.key 1.1.1.2:/usr/local/bind/etc/a.key
    scp b.key 1.1.1.2:/usr/local/bind/etc/b.key
     
    3. 配置主节点:1.1.1.1

    include "/usr/local/bind/etc/a.key";
    include "/usr/local/bind/etc/b.key";
    options {
    directory "/usr/local/bind/etc/";
    recursion yes;
    auth-nxdomain yes;
    transfer-format one-answer;
    version "[secured]";
    allow-query {any;};
    files 102400;
    };
    controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; };
    };
    logging {
    channel debug_log {
    file "named.log" versions 3 ;
    severity debug 10;
    print-time yes;
    print-category yes;
    print-severity yes;
    };
    category xfer-out {
    debug_log;
    };
    };

    view "a" {
    server 1.1.1.2 { keys a; };

    match-clients { !key b; 1.1.1.0/24; };
    recursion yes;

    zone "test.me" {
    type master;
    file "/usr/local/bind/etc/zonea";
    allow-transfer { 1.1.1.2; };
    };
    };

    view "b" {
    server 1.1.1.2 { keys b; };

    match-clients { !key a; 1.1.1.0/24; };
    recursion yes;

    zone "test.me" {
    type master;
    file "/usr/local/bind/etc/zoneb";
    allow-transfer { 1.1.1.2; };
    };
    };

    4. 配置从节点 : 1.1.1.2

    include "/usr/local/bind/etc/a.key";
    include "/usr/local/bind/etc/b.key";

    options {
    directory "/usr/local/bind/etc/";
    recursion yes;
    auth-nxdomain yes;
    transfer-format one-answer;
    version "[secured]";
    allow-query {any;};
    files 102400;
    };
    controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; };
    };
    logging {
    channel debug_log {
    file "named.log" versions 3 ;
    severity debug 10;
    print-time yes;
    print-category yes;
    print-severity yes;
    };
    category xfer-out {
    debug_log;
    };
    };

    view "a" {
    server 1.1.1.1 { keys a; };

    match-clients { !key b; 1.1.1.0/24; };
    recursion yes;

    zone "55tuan.me" {
    type slave;
    masters { 1.1.1.1; };
    file "/usr/local/bind/etc/zonea";
    };
    };

    view "b" {
    server 1.1.1.1 { keys b; };

    match-clients { !key a; 1.1.1.0/24; };
    recursion yes;

    zone "55tuan.me" {
    type slave;
    masters { 1.1.1.1; };
    file "/usr/local/bind/etc/zoneb";
    };
    };

     
    注意:
    1. master zone file serial NO. must be diff.
    2. match client must exclude the other key.
     
     
     
     
  • 相关阅读:
    利用条件信号量设计读写锁
    高效编程之互斥锁和自旋锁的一些知识
    高效编程之指针跳转的影响
    高效编程之cache命中对于程序性能的影响
    SQL Server中使用自定义指定顺序排序
    Vue使用,异步获取日期时间后格式成"/Date(1333245600000+0800)/" 转换成正常格式
    技术胖-胜洪宇关注web前端技术
    百度editor编辑器添加新字体
    mvc4中的 webapi 的使用方式
    js特效不错的网站
  • 原文地址:https://www.cnblogs.com/devops/p/3037580.html
Copyright © 2011-2022 走看看