大网数据广告活动
服务器运维问答

Bind, force zone update on slave

· 52CE 我爱测

I have two test servers master and slave: Master is updating slave but very slowly. How to speed this up. Master (192.168.0.122) /etc/named.conf zone "domain.com." { type master; file "caching-example/domain.com.db"; //allow-upda…

问题原文

原帖链接 · Abc Xyz · CC BY-SA 4.0

I have two test servers master and slave:

Master is updating slave but very slowly. How to speed this up.

Master (192.168.0.122) /etc/named.conf

zone "domain.com." {
    type master;
    file "caching-example/domain.com.db";
    //allow-update { key rndc-key;};
    notify yes;
    also-notify    { 192.168.0.66; };
    allow-transfer { 192.168.0.66; };
};

Slave (192.168.0.66) /etc/named.conf

zone "domain.com" {
    type slave;
    file "caching-example/domain.com.db";
    //allow-update { key rndc-key; };
    //allow-transfer { none; };
    allow-notify { 192.168.0.122; };
    masters      { 192.168.0.122; };
}

Master /var/named/caching-example/domain.com.db zone

$TTL    3600
$ORIGIN domain.com.
@       IN      SOA     darkstar.example.net.    root.example.net. (
                 2012033101         ; Serial
                       3600         ; Refresh
                       1800         ; Retry
                     604800         ; Expire
                      43200 )       ; Negative Cache TTL

    IN      NS      darkstar.example.net.

@       IN      A       162.144.18.114
www     IN      A       162.144.18.114

Now when i cahnge by hand master /var/named/caching-example/domain.com.db zone

$TTL    3600
$ORIGIN domain.com.
@       IN      SOA     darkstar.example.net.    root.example.net. (
                 2012033102         ; Serial
                       3600         ; Refresh
                       1800         ; Retry
                     604800         ; Expire
                      43200 )       ; Negative Cache TTL

    IN      NS      darkstar.example.net.

@       IN      A       8.8.8.8
www     IN      A       8.8.8.8

Nothing happens Master have domain.com at 8.8.8.8 and slave have domain.com at 162.144.18.114.

dig @192.168.0.122 domain.com

domain.com.     3600    IN  A   8.8.8.8

dig @192.168.0.66 domain.com

domain.com.     3600    IN  A   162.144.18.114

On slave was trying to use rndc but without success rndc refresh domain.com

zone refresh queued

Master is updating a slave but very slowly, is there any way to speed this up? I found that Negative Cache TTL is reposnsible for update time, but bind requires config reload. Is it possible to do update automatically?

Is it possible to force zone update from/on slave?

** EDIT **

Feb 16 01:00:21 darkstar named[1460]: client @0x7fec000bfea0 192.168.0.122#49018: received notify for zone 'domain.com'
Feb 16 01:00:21 darkstar named[1460]: zone domain.com/IN: notify from 192.168.0.122#49018: serial 2012033102
Feb 16 01:00:21 darkstar named[1460]: zone domain.com/IN: Transfer started.
Feb 16 01:00:21 darkstar named[1460]: transfer of 'domain.com/IN' from 192.168.0.122#53: connected using 192.168.0.66#51117
Feb 16 01:00:21 darkstar named[1460]: zone domain.com/IN: transferred serial 2012033102
Feb 16 01:00:21 darkstar named[1460]: transfer of 'domain.com/IN' from 192.168.0.122#53: Transfer status: success
Feb 16 01:00:21 darkstar named[1460]: transfer of 'domain.com/IN' from 192.168.0.122#53: Transfer completed: 1 messages, 5 records, 176 bytes, 0.003 secs (58666 bytes/sec)

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 4.0

Your setup is doing what it's supposed to do:

  1. You modify a zone file, including updating the SOA serial.
  2. You run rndc reload on master.
  3. Master sends notify/notifies on zone change.
  4. Slave(s) requests zone transfers.

BIND is not monitoring file changes i.e. it's normal that it doesn't do this automatically. You must run rndc reload on the master after every modification. A slave cannot force the master to reload configuration / zones.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。