对智能DNS的master和slave同步的一点总结
2009-12-26 12:17
253 查看
对智能DNS的master和slave的同步测试进行了将近半个月,总是陷入种种的错误和谜团,甚至是产生过放弃测试的念头。然后总是在自己认为无路可走的情况下,柳暗花明。此次将经验总结出来,希望在正式搭建以及其他人进行测试的时候能少遇到一些问题。
一、获取ip分配的方法
获得中国电信、网通、铁通IP段的四种方法:
详见:http://blog.csdn.net/liuyunfengheda/archive/2009/12/26/5080446.aspx
中间比较适合使用的也就是方法二了,测试的过程中也尝试使用其他的方法,但是使用感觉不如方法二直接和方便,特别是4的方法,因为软件需要破解,或者付费才能使用,比较复杂。
二、搭建智能DNS(无slave)。
详细的方法可以参照我直接做的搭建过程的blog:http://blog.csdn.net/liuyunfengheda/archive/2009/11/06/4777151.aspx
对于搭建的过程blog中写的都比较详细了,如果有什么疑问,可以再沟通。
三、搭建智能DNS,实现Master和Slave自动同步
这部分的测试耗费的时间是最长的,因为在测试的过程中一直无法实现master和slave的自动同步,同步的过程中总是出现这样可那样的错误。好在能坚持下来,并测试通过。
下面是测试环境以及配置文件,大家可以根据自己的情况作修改,然后搭建实现Master和Slave的自动同步智能DNS服务器。
测试环境:
dx.cfg
acl dx {
192.168.12.249;
192.168.12.253;
X.X.X.X;}; -------这部分是指定电信的ip,需要注意的是上面的两个内网ip是实现同步电信view的两个ip,是必须设置的,不然在同步的过程中就会出现错误。
wt.cfg
acl wt {
192.168.5.246;
192.168.5.247;
any;}; -----原理同上,但是any是只能除了dx之外的所有ip都 走网通的view。
DNS主服务器:
Eth0:192.168.12.249
Eth1:192.168.5.247
/etc/named.conf
options
{
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
pid-file "/var/run/named/named.pid";
forward only;
Forwarders
{
202.102.224.68;
202.102.227.68;
};
allow-query {any;};
allow-transfer {any;};
notify yes;
};
key "rndckey" {
algorithm hmac-md5;
secret "Je8vfxcByy6hnTxHa7M1qQ==";
};
#include "/etc/rndc.key";
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
include "dx.cfg";
include "wt.cfg";
view "dxzone" {
match-clients {dx;192.168.12.253;!192.168.5.246;};
allow-transfer {192.168.12.253;};
# allow-update { 192.168.12.253; };
also-notify { 192.168.12.253; };
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Master;
file "named.localhost";
};
Zone "xxt.cn"
{
type master;
file "telcom.xxt.cn";
};
Zone "xxt.net.cn"
{
type master;
file "telcom.xxt.net.cn";
};
};
view "wtzone" {
match-clients {wt;!192.168.12.253;192.168.5.246;};
allow-transfer {192.168.5.246;};
# allow-update { 192.168.5.246; };
also-notify { 192.168.5.246; };
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Master;
file "named.localhost";
};
Zone "xxt.cn"
{
type master;
file "unicom.xxt.cn";
};
Zone "xxt.net.cn"
{
type master;
file "unicom.xxt.net.cn";
};
};
从DNS服务器的配置:
Eth0:192.168.12.254
Eth0:1:192.168.12.253
Eth1:192.168.5.246
/etc/named.conf
options
{
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
pid-file "/var/run/named/named.pid";
forward only;
Forwarders
{
202.102.224.68;
202.102.227.68;
};
allow-query {any;};
allow-transfer {any;};
notify yes;
};
key "rndckey" {
algorithm hmac-md5;
secret "Je8vfxcByy6hnTxHa7M1qQ==";
};
#include "/etc/rndc.key";
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
include "dx.cfg";
include "wt.cfg";
view "dxzone" {
match-clients {dx;192.168.12.253;!192.168.5.246;};
transfer-source 192.168.12.253;
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Slave;
file "named.localhost";
masters {192.168.12.249;};
};
Zone "xxt.cn"
{
type Slave;
file "telcom.xxt.cn";
masters {192.168.12.249;};
};
Zone "xxt.net.cn"
{
type Slave;
file "telcom.xxt.net.cn";
masters {192.168.12.249;};
};
};
view "wtzone" {
match-clients {wt;!192.168.12.253;192.168.5.246;};
transfer-source 192.168.5.246;
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Slave;
file "named.localhost";
masters {192.168.5.247;};
};
Zone "xxt.cn"
{
type Slave;
file "unicom.xxt.cn";
masters {192.168.5.247;};
};
Zone "xxt.net.cn"
{
type Slave;
file "unicom.xxt.net.cn";
masters {192.168.5.247;};
};
};
一、获取ip分配的方法
获得中国电信、网通、铁通IP段的四种方法:
详见:http://blog.csdn.net/liuyunfengheda/archive/2009/12/26/5080446.aspx
中间比较适合使用的也就是方法二了,测试的过程中也尝试使用其他的方法,但是使用感觉不如方法二直接和方便,特别是4的方法,因为软件需要破解,或者付费才能使用,比较复杂。
二、搭建智能DNS(无slave)。
详细的方法可以参照我直接做的搭建过程的blog:http://blog.csdn.net/liuyunfengheda/archive/2009/11/06/4777151.aspx
对于搭建的过程blog中写的都比较详细了,如果有什么疑问,可以再沟通。
三、搭建智能DNS,实现Master和Slave自动同步
这部分的测试耗费的时间是最长的,因为在测试的过程中一直无法实现master和slave的自动同步,同步的过程中总是出现这样可那样的错误。好在能坚持下来,并测试通过。
下面是测试环境以及配置文件,大家可以根据自己的情况作修改,然后搭建实现Master和Slave的自动同步智能DNS服务器。
测试环境:
dx.cfg
acl dx {
192.168.12.249;
192.168.12.253;
X.X.X.X;}; -------这部分是指定电信的ip,需要注意的是上面的两个内网ip是实现同步电信view的两个ip,是必须设置的,不然在同步的过程中就会出现错误。
wt.cfg
acl wt {
192.168.5.246;
192.168.5.247;
any;}; -----原理同上,但是any是只能除了dx之外的所有ip都 走网通的view。
DNS主服务器:
Eth0:192.168.12.249
Eth1:192.168.5.247
/etc/named.conf
options
{
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
pid-file "/var/run/named/named.pid";
forward only;
Forwarders
{
202.102.224.68;
202.102.227.68;
};
allow-query {any;};
allow-transfer {any;};
notify yes;
};
key "rndckey" {
algorithm hmac-md5;
secret "Je8vfxcByy6hnTxHa7M1qQ==";
};
#include "/etc/rndc.key";
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
include "dx.cfg";
include "wt.cfg";
view "dxzone" {
match-clients {dx;192.168.12.253;!192.168.5.246;};
allow-transfer {192.168.12.253;};
# allow-update { 192.168.12.253; };
also-notify { 192.168.12.253; };
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Master;
file "named.localhost";
};
Zone "xxt.cn"
{
type master;
file "telcom.xxt.cn";
};
Zone "xxt.net.cn"
{
type master;
file "telcom.xxt.net.cn";
};
};
view "wtzone" {
match-clients {wt;!192.168.12.253;192.168.5.246;};
allow-transfer {192.168.5.246;};
# allow-update { 192.168.5.246; };
also-notify { 192.168.5.246; };
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Master;
file "named.localhost";
};
Zone "xxt.cn"
{
type master;
file "unicom.xxt.cn";
};
Zone "xxt.net.cn"
{
type master;
file "unicom.xxt.net.cn";
};
};
从DNS服务器的配置:
Eth0:192.168.12.254
Eth0:1:192.168.12.253
Eth1:192.168.5.246
/etc/named.conf
options
{
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
pid-file "/var/run/named/named.pid";
forward only;
Forwarders
{
202.102.224.68;
202.102.227.68;
};
allow-query {any;};
allow-transfer {any;};
notify yes;
};
key "rndckey" {
algorithm hmac-md5;
secret "Je8vfxcByy6hnTxHa7M1qQ==";
};
#include "/etc/rndc.key";
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
include "dx.cfg";
include "wt.cfg";
view "dxzone" {
match-clients {dx;192.168.12.253;!192.168.5.246;};
transfer-source 192.168.12.253;
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Slave;
file "named.localhost";
masters {192.168.12.249;};
};
Zone "xxt.cn"
{
type Slave;
file "telcom.xxt.cn";
masters {192.168.12.249;};
};
Zone "xxt.net.cn"
{
type Slave;
file "telcom.xxt.net.cn";
masters {192.168.12.249;};
};
};
view "wtzone" {
match-clients {wt;!192.168.12.253;192.168.5.246;};
transfer-source 192.168.5.246;
Zone "."
{
type Hint;
file "named.root";
};
Zone "localhost"
{
type Slave;
file "named.localhost";
masters {192.168.5.247;};
};
Zone "xxt.cn"
{
type Slave;
file "unicom.xxt.cn";
masters {192.168.5.247;};
};
Zone "xxt.net.cn"
{
type Slave;
file "unicom.xxt.net.cn";
masters {192.168.5.247;};
};
};
相关文章推荐
- MySQL数据库主从(Master/Slave)同步安装与配置总结
- 多数据库 master-slave 不同步问题总结
- 遇到 bind DNS 的 Master 与 Slave 不能同步更新问题
- mysql的master和slave主从同步问题总结
- MySQL5.6 数据库主从(Master/Slave)同步安装与配置详解
- MYSQL5.6.33数据库主从(Master/Slave)同步安装与配置详解(Master-Linux Slave-windows7)
- (精典教程)在MySql上实现Replication(Master 与 Slave 数据同步)
- mysql 实现master-slave 同步
- MySQL5.6 数据库主从(Master/Slave)同步安装与配置详解
- 续bind98-内网智能DNS之slave服务器构建
- MySQL主从复制(Master-Slave),半同步复制与读写分离(MySQL-Proxy)
- BIND Master/Slave DNS 與 View 的搭配
- Mysql 5.5 replication 多数据库主从备份Master-Slave配置总结
- Centos下Mysql多主机master单机多实例slave同步配置
- mysql master与slave完美同步,多机同步备份以及快速切换攻略1
- Linux(Ubuntu)环境MYSQL->master/slave主从同步设置以及注意事项
- OpenLDAP Master-Slave同步复制
- 基于MySQL Master Slave同步配置的操作详解
- MySQL Master/Slave 主从数据同步
- mysql 数据同步---master (window),slave(linux)