# Master-Slave Dynamic update problem



## kimkaphann (Oct 27, 2013)

I'm using BIND98. I installed two DNS servers: 1 master and 1 slave.

MASTER - 192.168.1.50/24


```
listen-on       { 127.0.0.1; 192.168.1.50;};

zone "example.local" {
    type master;
    file "/etc/namedb/dynamic/example.local";
    allow-transfer{192.168.1.51;};
    update-policy {grant example.local zonesub ANY;};
};


zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/namedb/dynamic/1.168.192.in-addr.arpa";
    allow-transfer{192.168.1.51;};
    update-policy {grant example.local zonesub ANY;};

};

key example.local {
    algorithm hmac-md5;
    secret "VWkPipeITrU55MeA5s5M5w==";
};[/QUOTE][quote]
$ORIGIN .
$TTL 3600       ; 1 hour
example.local              IN SOA  example.local. admin1.example.local. (
                                2013102714 ; serial
                                10800      ; refresh (3 hours)
                                3600       ; retry (1 hour)
                                604800     ; expire (1 week)
                                300        ; minimum (5 minutes)
                                )
                        NS      slave.example.local.
                        NS      master.example.local.
                        A       192.168.1.50
                        MX      1 mail.example.local.example.local.
$ORIGIN example.local.
master                  A       192.168.1.50
slave                   A       192.168.1.51
```

Slave - 192.168.1.51/24


```
zone "example.local" {
    type slave;
    file "/etc/namedb/slave/example.local";
    masters {192.168.1.50;};
};

zone "1.168.192.in-addr.arpa" {
    type slave;
    file "/etc/namedb/slave/1.168.192.in-addr.arpa";
    masters {192.168.1.50;};
};
```

When I manually change zone files (both forward and reverse) in master, it'll automatic update to slave. When I use dynamic update, slave notifies that its transfers are complete, but nothing happens (serial doe not update and nothing changes in the zone file).

Can someone help me fix this?


```
#nsupdate -k Kwada.local.+157+34281.key
> update add test1.example.local 3600 IN A 192.168.1.55
>send
```


```
#more /etc/namedb/slave/example.local

xfer-in: info: transfer of 'example.local/IN' from 192.168.1.50#53: connected using 192.168.1.51#40655
xfer-in: info: transfer of 'example.local/IN' from 192.168.1.50#53: Transfer completed: 1 messages, 5 records,
```


----------



## kimkaphann (Oct 28, 2013)

It solved..Thanks anyway


----------



## DutchDaemon (Oct 28, 2013)

How?


----------



## kimkaphann (Oct 28, 2013)

When *I* used `nsupdate`, it already applied to BIND (both master and slave), checked by `nslookup`, although zone files didn't update.


```
#more /etc/namedb/slave/example.local

xfer-in: info: transfer of 'example.local/IN' from 192.168.1.50#53: connected using 192.168.1.51#40655
xfer-in: info: transfer of 'example.local/IN' from 192.168.1.50#53: Transfer completed: 1 messages, 5 records,
```

I think BIND stored new update information in *.jrl. After I restarted the named service, it writes zone files.


----------



## kpa (Oct 28, 2013)

Don't trust the zone files alone when you're using dynamic updates, the database state is the zone files plus the journal .jrl files. After a while BIND will commit the journal file contents to the zone files and the journal files will disappear.


----------

