12

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)
5
  • What's in the logs? Feb 16, 2019 at 14:13
  • I did changed question because i found in log ` zone domain.com/IN: transferred serial 2012033102` i found that bind is updating slave but very slowly then i found how to speed it up - but, bind is not updating it automatically i need to reload bind on master to see change effect on slave.
    – Abc Xyz
    Feb 16, 2019 at 14:48
  • 1
    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. Feb 16, 2019 at 14:56
  • I just checked that's it rndc reload on master did the job, thx. this is the answer for my question.
    – Abc Xyz
    Feb 16, 2019 at 15:00
  • I made it an answer, then. :) Feb 16, 2019 at 15:06

2 Answers 2

19

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.

1
  • 2
    This is triggering a reload on the slave using a NOTIFY from the master. However sometimes you want an unpublished slave (ie no NS record for it) in which case this doesnt work as the master doesnt send a notify. The OP should either (a) add an NS record for their secondary so it receives notifies, or (b) use the rndc retransfer on the slave as in the answer below Feb 2, 2021 at 4:46
31

Late reply to your unanswered question:

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

I just wanted to speed up/force a transfer and used this on my slave for each outdated domain:

rndc retransfer domain.com
2
  • 5
    This should be the answer for Bind9 v9.11.0 or higher. Oct 15, 2020 at 15:10
  • 1
    This is a better answer if you want to trigger the reload from the slave. However if you add an NS record to the zone pointing at the slave it should cause notifies to be sent and the reload happen automatically Feb 2, 2021 at 4:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .