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.
 
 
 
 

转载于:https://www.cnblogs.com/devops/archive/2013/04/23/3037580.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值