免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2612 | 回复: 5
打印 上一主题 下一主题

[DNS] 主从DNS使用views后,更新不同步,附全部配置文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-17 14:36 |只看该作者 |倒序浏览
本人网络情况:
----isp1----|                                               | 主DNS服务器    192.168.40.3
                 |---->防火墙---->负载均衡----- >
----isp2----|                                 |从DNS服务器   192.168.40.4

主从DNS连接在同一局域网上,利用views功能,南北电信走不同ISP线路。下面是配置文件,请帮我指点一下哪些设置可以进行调整优化?


master IP(192.168.40.3)
#vi named.conf

key "rndc-key" {
        algorithm hmac-md5;
        secret "OSNRVVzCYPystxBN4LrWlA==";
};
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};
options {
directory "/var/named"; #named work dic
pid-file "named.pid"; #put pid in work dic
};

// test for slave xfer log
      logging {
              channel xfer-out {
                      file "xfer-out.log"        versions 3 size 20m;
                      severity        info;
                      print-time        yes;
                      print-category  yes;
              };
              category xfer-out {
                      xfer-out;
              };
      };
//include cnc acl
include "acl.conf";
//view add by david
view "view_cnc" {
        match-clients { CNC; };
        recursion yes;
        notify-source 192.168.40.3;
        transfer-source 192.168.40.3;
        query-source address 192.168.40.3;
        zone "." {
                type hint;
                file "named.root";
        };

        zone "0.0.127.IN-ADDR.ARPA" {
                type master;
                file "named.local";
        };
        include "master/cnc.def";
};

view "view_any" {
        match-clients { any; };
        recursion yes;
        notify-source 192.168.40.3;
        transfer-source 192.168.40.3;
        query-source address 192.168.40.3;
        zone "." {
                type hint;
                file "named.root";
        };
     zone "0.0.127.IN-ADDR.ARPA" {
                type master;
                file "named.local";
        };
        include "master/telecom.def";
};

# more rndc.conf
# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "OSNRVVzCYPystxBN4LrWlA==";
};

options {
        default-key "rndc-key";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf

#more localhost.zone

$TTL    86400
$ORIGIN localhost.
@                       1D IN SOA       @ root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        @
                        1D IN A         127.0.0.1

#more named.local
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     localhost.

#vi cnc.def
"cnc.def" 14 lines, 252 characters
zone "test.com" {
        type master;
        file "master/cnc/test.com";
        allow-transfer {
                192.168.40.4;
        };
};
zone "eatcn.com" {
        type master;
        file "master/cnc/eatcn.com";
        allow-transfer {
                192.168.40.4;
        };
};

# more telecom.def
zone "test.com" {
type master;
file "master/telecom/test.com";
allow-transfer {192.168.40.4;};
};
zone "eatcn.com" {
type master;
file "master/telecom/eatcn.com";
allow-transfer {192.168.40.4;};
};


#more cnc/eatcn.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2006021712 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       218.109.20.212
www     IN      A       218.109.20.214
bbs     IN      A       218.109.20.212

#more cnc/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2006021712 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       218.109.20.212
www     IN      A       218.109.20.214
bbs     IN      A       218.109.20.212

# more telecom/eatcn.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2006021712 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       218.109.20.212
www     IN      A       218.109.20.214
bbs     IN      A       218.109.20.212


#more telecom/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2005121013 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       60.191.253.28
www     IN      A       60.191.253.28


slave IP(192.168.40.4)
#vi named.conf
# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "OSNRVVzCYPystxBN4LrWlA==";
};
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};
options {
directory "/var/named"; #named work dic
pid-file "named.pid"; #put pid in work dic
};

// test for slave xfer log
      logging {
              channel xfer-out {
                      file "xfer-out.log"        versions 3 size 20m;
                      severity        info;
                      print-time        yes;
                      print-category  yes;
              };
              category xfer-in {
                      xfer-out;
              };
      };
//include cnc acl
include "acl.conf";
//view add by david
view "view_cnc" {
        match-clients { CNC; };
        recursion yes;
        notify-source 192.168.40.4;
        transfer-source 192.168.40.4;
        query-source address 192.168.40.4;
        zone "." {
                type hint;
                file "named.root";
        };
        zone "0.0.127.IN-ADDR.ARPA" {
                type master;
                file "named.local";
        };
        include "master/cnc.def";
};

view "view_any" {
        match-clients { any; };
        recursion yes;
        notify-source 192.168.40.4;
        transfer-source 192.168.40.4;
        query-source address 192.168.40.4;
        zone "." {
                type hint;
                file "named.root";
        };

        zone "0.0.127.IN-ADDR.ARPA" {
                type master;
                file "named.local";
        };
        include "master/telecom.def";
};

#more /usr/local/named/etc/rndc.conf  
# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "OSNRVVzCYPystxBN4LrWlA==";
};

options {
        default-key "rndc-key";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf



# more localhost.zone
$TTL    86400
$ORIGIN localhost.
@                       1D IN SOA       @ root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        @
                        1D IN A         127.0.0.1


# more named.local
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     localhost.


# more cnc.def
zone "test.com" {
type slave;
file "master/cnc/test.com";
masters {192.168.40.3;};
};

# more telecom.def
zone "test.com" {
type slave;
file "master/telecom/test.com";
masters {192.168.40.3;};
};


# more cnc/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2005121013 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       218.109.20.212
www     IN      A       218.109.20.212

# more telecom/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(
        2005121013 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.
        IN      A       60.191.253.28   
www     IN      A       60.191.253.28



vi acl.conf
"acl.conf" 165 lines, 2560 characters
//cnc acl list by david
acl "CNC" {
192.168.40.200;
58.16.0.0/16;
58.17.0.0/17;
58.17.128.0/17;
58.18.0.0/16;
58.19.0.0/16;
58.20.0.0/16;
58.22.0.0/15;
58.240.0.0/15;
58.242.0.0/15;
58.246.0.0/15;
58.248.0.0/13;
60.0.0.0/13;
60.8.0.0/15;
60.10.0.0/16;
60.11.0.0/16;
60.12.0.0/16;
60.13.0.0/18;
60.13.128.0/17;
60.14.0.0/15;
60.16.0.0/13;
60.24.0.0/14;
60.28.0.0/15;
60.30.0.0/16;
60.31.0.0/16;
60.208.0.0/13;
60.216.0.0/15;
60.218.0.0/15;
60.220.0.0/14;
61.48.0.0/13;
61.133.0.0/17;
61.134.96.0/19;
61.134.128.0/17;
61.135.0.0/16;
61.137.128.0/17;
61.138.0.0/17;
61.138.128.0/18;
61.139.128.0/18;
61.148.0.0/15;
61.156.0.0/16;
61.159.0.0/18;
61.161.0.0/18;
61.161.128.0/17;
61.162.0.0/16;
61.163.0.0/16;
61.167.0.0/16;
61.168.0.0/16;
61.176.0.0/16;
61.179.0.0/16;
61.181.0.0/16;
61.182.0.0/16;
61.189.0.0/17;
202.96.0.0/18;
202.96.64.0/21;
202.96.72.0/21;
202.97.128.0/18;
202.97.224.0/21;
202.97.240.0/20;
202.98.0.0/21;
202.98.8.0/21;
202.99.64.0/19;
202.99.96.0/21;
202.99.128.0/19;
202.99.160.0/21;
202.99.168.0/21;
202.99.176.0/20;
202.99.208.0/20;
202.99.224.0/21;
202.99.232.0/21;
202.99.240.0/20;
202.102.128.0/21;
202.102.224.0/21;
202.102.232.0/21;
202.106.0.0/16;
202.107.0.0/17;
202.108.0.0/16;
202.110.0.0/17;
202.111.128.0/18;
203.93.8.0/24;
203.93.192.0/18;
210.13.128.0/17;
210.14.160.0/19;
210.14.192.0/19;
210.15.32.0/19;
210.15.96.0/19;
210.15.128.0/18;
210.21.0.0/16;
210.52.128.0/17;
210.53.0.0/17;
210.53.128.0/17;
210.74.96.0/19;
210.74.128.0/19;
210.82.0.0/15;
218.8.0.0/14;
218.12.0.0/16;
218.21.128.0/17;
218.24.0.0/14;
218.56.0.0/14;
218.60.0.0/15;
218.67.128.0/17;
218.68.0.0/15;
218.104.0.0/14;
219.154.0.0/15;
219.156.0.0/15;
219.158.0.0/17;
219.158.128.0/17;
219.159.0.0/18;
220.252.0.0/16;
221.0.0.0/15;
221.2.0.0/16;
221.3.0.0/17;
221.3.128.0/17;
221.4.0.0/16;
221.5.0.0/17;
221.5.128.0/17;
221.6.0.0/16;
221.7.0.0/19;
221.7.32.0/19;
221.7.64.0/19;
221.7.96.0/19;
221.8.0.0/15;
221.10.0.0/16;
221.11.0.0/17;
221.11.128.0/18;
221.11.192.0/19;
221.12.0.0/17;
221.12.128.0/18;
221.13.0.0/18;
221.13.64.0/19;
221.13.96.0/19;
221.13.128.0/17;
221.14.0.0/15;
221.192.0.0/15;
221.194.0.0/16;
221.195.0.0/16;
221.196.0.0/15;
221.198.0.0/16;
221.199.0.0/19;
221.199.32.0/20;
221.199.128.0/18;
221.199.192.0/20;
221.200.0.0/14;
221.204.0.0/15;
221.206.0.0/16;
221.207.0.0/18;
221.207.64.0/18;
221.207.128.0/17;
221.208.0.0/14;
221.212.0.0/16;
221.213.0.0/16;
221.216.0.0/13;
222.128.0.0/14;
222.132.0.0/14;
222.136.0.0/13;
222.160.0.0/15;
222.162.0.0/16;
222.163.0.0/19;
218.108.0.0/16;
58.100.0.0/16;
219.82.0.0/16;
218.109.0.0/16;
};

[ 本帖最后由 落伍者 于 2006-2-17 15:20 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-02-17 14:54 |只看该作者
现在主从模式,主更新后,已经加大Serial,但从DNS没有更新,我加了日志,但好像日志不知道应该怎么加,显示出来的日志没有xfer相关的信息,不知应该如何记录我想要的关于主从DNS更新的日志信息,另,可否帮我看看主从更新问题出在哪里?
# more cnc/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(     //可否帮我解释一下这一行是具体意思?
        2005121013 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.           //可否帮我解释一下这一行是具体意思?
        IN      A       218.109.20.212
www     IN      A       218.109.20.212


# more telecom/eatcn.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.( //可否帮我解释一下这一行是具体意思?这里的ns.test.com是否需要改为ns.eatcn.com
        2006021712 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.                 //可否帮我解释一下这一行是具体意思?
        IN      A       218.109.20.212
www     IN      A       218.109.20.214
bbs     IN      A       218.109.20.212

论坛徽章:
0
3 [报告]
发表于 2006-02-17 16:01 |只看该作者
SOA中的ns.test.com. root.ns.test.com为测试值,现在我已经在我的域名运营商上申请注册了DNS的域名ns1.eatcn.com,ns2.eatcn.com 是否相应的ns.test.com root.ns.test.com改为ns1.eatcn.com,ns2.eatcn.com?

论坛徽章:
0
4 [报告]
发表于 2006-02-17 19:51 |只看该作者
# more cnc/test.com
$TTL 3600
@ IN SOA ns.test.com. root.ns.test.com.(   //test.com的授权DNS为ns.test.com,这个DNS的联系人为:root@ns.test.com
        2005121013 ;Serial
        3600 ; Refresh ( seconds )
        900 ; Retry ( seconds )
        68400 ; Expire ( seconds )
        15 );Minimum TTL for Zone ( seconds )
        IN      NS      ns.test.com.           //test.com使用的DNS服务器为ns.test.com
        IN      A       218.109.20.212
www     IN      A       218.109.20.212


不知自问自答正确否?

论坛徽章:
0
5 [报告]
发表于 2006-10-04 19:45 |只看该作者
soa后的第一个应该表示此域名的根服务器,第二个是电子邮件地址,是root@ns.test.com.,因为@在这个文件中定义了其他的功能,所以表示为root.ns.test.com,这是我的理解,不知道对你有没有帮助

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
6 [报告]
发表于 2006-10-04 20:00 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP