# Problem with configure dhcp+bind dynamic-updated zone.

## IRON

Hello all.

I try configure dhcp with dynamicaly updated zone. My local zone is "local". Backward zone updates working normal, but direct viewing zone is NOT updated  :Sad: . That is zone "0.168.192.in-addr.arpa" is updated correctly from dhcp, but zone "local" is not updated.

named.conf

```
options {

        directory "/var/bind";

        listen-on-v6 { none; };

        listen-on { 127.0.0.1; 192.168.0.254; };

        allow-query { 192.168.0.0/24; localhost; };

        max-cache-size 32768;

        pid-file "/var/run/named/named.pid";

};

zone "." IN {

        type hint;

        file "named.ca";

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127.zone";

        allow-update { none; };

        notify no;

};

key DHCP_UPDATER {

         algorithm HMAC-MD5.SIG-ALG.REG.INT;

         secret VbvVpLkDEUqNdACxix1U6w==;

       };

zone "local" IN {

        type master;

        file "pri/local.zone";

        allow-update { key DHCP_UPDATER; };

};

zone "0.168.192.in-addr.arpa" IN {

        type master;

        file "pri/192.168.0.zone";

        allow-update { key DHCP_UPDATER; };

};
```

dhcpd.conf

```
subnet 192.168.0.0 netmask 255.255.255.0 {

  range 192.168.0.200 192.168.0.239;

  option domain-name-servers 192.168.0.254;

  option subnet-mask 255.255.255.0;

  option domain-name "local";

  option routers 192.168.0.254;

  option broadcast-address 192.168.0.255;

  default-lease-time 600;

  max-lease-time 7200;

}

host pc6 {

  hardware ethernet 00:11:D8:E6:EC:01;

  fixed-address 192.168.0.6;

  server-name "pc6.local";

}

host pc7 {

  hardware ethernet 00:01:02:09:56:25;

  fixed-address 192.168.0.7;

  server-name "pc7.local";

}

ddns-update-style interim;

ignore client-updates;

authoritative;

key DHCP_UPDATER {

algorithm hmac-md5;

secret VbvVpLkDEUqNdACxix1U6w==;

};

zone 0.168.192.in-addr.arpa. {

    primary 127.0.0.1;

    key DHCP_UPDATER;

}

zone local. {

    primary 127.0.0.1;

    key DHCP_UPDATER;

}
```

When startng named,I see in /var/log/syslog:

```
Oct 29 02:17:10 media named[5971]: starting BIND 9.2.5 -u named -n 1

Oct 29 02:17:10 media named[5971]: using 1 CPU

Oct 29 02:17:10 media named[5971]: loading configuration from '/etc/bind/named.conf'

Oct 29 02:17:10 media named[5971]: listening on IPv4 interface lo, 127.0.0.1#53

Oct 29 02:17:10 media named[5971]: listening on IPv4 interface eth0, 192.168.0.254#53

Oct 29 02:17:10 media named[5971]: command channel listening on 127.0.0.1#953

Oct 29 02:17:10 media named[5971]: zone 127.in-addr.arpa/IN: loaded serial 2002081601

Oct 29 02:17:10 media named[5971]: zone 0.168.192.in-addr.arpa/IN: loaded serial 2002081613

Oct 29 02:17:10 media named[5971]: zone local/IN: journal rollforward failed: not exact

Oct 29 02:17:10 media named[5971]: running
```

Firewall did'nt blocking incoming connections:

```
media ~ # iptables -L -v -n | grep 192.168.0.0

4400K 1321M ACCEPT     all  --  *      *       192.168.0.0/24       0.0.0.0/0

media ~ # iptables -L -v -n | grep 127.0.0.0

 4137  494K ACCEPT     all  --  *      *       127.0.0.0/8          0.0.0.0/0
```

/var/bind/pri/local.zone

```
$ORIGIN .

$TTL 86400      ; 1 day

local.       IN      SOA     ns.local. nsadmin (

                                      2002081601 ; Serial

                                      300      ; Refresh

                                      14400      ; Retry

                                      604800     ; Expire - 1 week

                                      86400 )    ; Minimu

$ORIGIN local.

$TTL 302400     ; 3 days 12 hours

ns              IN      A       192.168.0.254
```

/var/bind/pri/192.168.0.zone

```
$ORIGIN .

$TTL 86400      ; 1 day

0.168.192.in-addr.arpa  IN SOA  ns.local root.local. (

                                2002081613 ; serial

                                300      ; refresh (3 hours)10800

                                900        ; retry (15 minutes)

                                604800     ; expire (1 week)

                                86400      ; minimum (1 day)

                                )

                        NS      ns.local

$ORIGIN 0.168.192.in-addr.arpa.

$TTL 302400     ; 3 days 12 hours

211                     PTR     editor1.local.

6                       PTR     pc6.local.

241                     PTR     photoshop.local.
```

/etc/hosts

```
127.0.0.1       localhost

192.168.0.254   media.local
```

/etc/conf.d/hostname

```
HOSTNAME="media.local"
```

/etc/host.conf

```
order bind, hosts

mdns off

multi off
```

nslookup

```
media ~ # nslookup

> 192.168.0.6

Server:         127.0.0.1

Address:        127.0.0.1#53

6.0.168.192.in-addr.arpa        name = pc6.local.

> pc6.local

Server:         127.0.0.1

Address:        127.0.0.1#53

** server can't find pc6.local: SERVFAIL

```

What happend with my BIND ? Why "local" zone is not updating ?

tnx...

----------

## steveb

try changing in named.conf the following sections:

from:

```
key DHCP_UPDATER { 

          algorithm HMAC-MD5.SIG-ALG.REG.INT; 

          secret VbvVpLkDEUqNdACxix1U6w==; 

        };
```

to:

```
key "DHCP_UPDATER" { 

          algorithm hmac-md5; 

          secret "VbvVpLkDEUqNdACxix1U6w=="; 

        };
```

from:

```
zone "local" IN { 

         type master; 

         file "pri/local.zone"; 

         allow-update { key DHCP_UPDATER; }; 

 };
```

to:

```
zone "local" IN { 

         type master; 

         file "pri/local.zone"; 

         allow-update { key "DHCP_UPDATER"; }; 

 };
```

change /var/bind/pri/local.zone:

from:

```
$ORIGIN . 

 $TTL 86400      ; 1 day 

 local.       IN      SOA     ns.local. nsadmin ( 

                                       2002081601 ; Serial 

                                       300      ; Refresh 

                                       14400      ; Retry 

                                       604800     ; Expire - 1 week 

                                       86400 )    ; Minimu 

 $ORIGIN local. 

 $TTL 302400     ; 3 days 12 hours 

 ns              IN      A       192.168.0.254
```

to:

```
$ORIGIN . 

 $TTL 86400      ; 1 day 

 local.       IN      SOA     ns.local. nsadmin.local. ( 

                                       2005102901 ; Serial 

                                       300      ; Refresh 

                                       900       ; Retry 

                                       604800     ; Expire - 1 week 

                                       86400 )    ; Minimu

                 IN      NS      ns.local.

 $ORIGIN local. 

 $TTL 302400     ; 3 days 12 hours 

 ns              IN      A       192.168.0.254
```

cheers

SteveB

----------

## IRON

In /var/log/syslog I see:

```
Oct 29 11:27:59 media named[6484]: starting BIND 9.2.5 -u named -n 1

Oct 29 11:27:59 media named[6484]: using 1 CPU

Oct 29 11:27:59 media named[6484]: loading configuration from '/etc/bind/named.conf'

Oct 29 11:27:59 media named[6484]: listening on IPv4 interface lo, 127.0.0.1#53

Oct 29 11:27:59 media named[6484]: listening on IPv4 interface eth0, 192.168.0.254#53

Oct 29 11:27:59 media named[6484]: command channel listening on 127.0.0.1#953

Oct 29 11:27:59 media named[6484]: zone 127.in-addr.arpa/IN: loaded serial 2002081601

Oct 29 11:27:59 media named[6484]: zone 0.168.192.in-addr.arpa/IN: loaded serial 2002081613

Oct 29 11:27:59 media named[6484]: dns_master_load: pri/local.zone:2: no current owner name

Oct 29 11:27:59 media named[6484]: zone local/IN: loading master file pri/local.zone: no owner

Oct 29 11:27:59 media named[6484]: running
```

Last edited by IRON on Sat Oct 29, 2005 12:46 pm; edited 1 time in total

----------

## steveb

Sorry! Had a error in /var/bind/pri/local.zone. Please change the file to:

```
$ORIGIN .

$TTL 86400      ; 1 day

local           IN SOA  ns.local. nsadmin.local. (

                        2005102902 ; serial

                        300        ; refresh (5 minutes)

                        900        ; retry (10 minutes)

                        604800     ; expire (1 week)

                        86400      ; minimum (1 day)

                        )

                NS      ns.local.

                A       192.168.0.254

$ORIGIN local.

$TTL 302400     ; 3 days 12 hours 

ns              A       192.168.0.254
```

cheers

SteveB

----------

## IRON

Named starts correctly, without errors:

```
Oct 29 15:31:41 media named[6369]: starting BIND 9.2.5 -u named -n 1

Oct 29 15:31:41 media named[6369]: using 1 CPU

Oct 29 15:31:41 media named[6369]: loading configuration from '/etc/bind/named.conf'

Oct 29 15:31:41 media named[6369]: listening on IPv4 interface lo, 127.0.0.1#53

Oct 29 15:31:41 media named[6369]: listening on IPv4 interface eth0, 192.168.0.254#53

Oct 29 15:31:41 media named[6369]: command channel listening on 127.0.0.1#953

Oct 29 15:31:41 media named[6369]: zone 127.in-addr.arpa/IN: loaded serial 2002081601

Oct 29 15:31:41 media named[6369]: zone 0.168.192.in-addr.arpa/IN: loaded serial 2002081613

Oct 29 15:31:41 media named[6369]: zone local/IN: loaded serial 2005102902

Oct 29 15:31:41 media named[6369]: running
```

...but when I try to update zone using #nsupdate, nothing happends

```
media bind # cat tmp

key DHCP_UPDATER VbvVpLkDEUqNdACxix1U6w==

zone local

update add pc5 86400 A 192.168.0.239

send

zone 0.168.192.in-addr.arpa

update add 239 86400 PTR pc5.local.

send
```

```
media bind # nsupdate -d tmp

Reply from SOA query:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:   6192

;; flags: qr rd ra ; QUESTION: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;pc5.                           IN      SOA

;; AUTHORITY SECTION:

.                       0       IN      SOA     A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2005102801 1800 900 604800 86400

Found zone name: .

The master is: A.ROOT-SERVERS.NET

before getaddrinfo()

; TSIG error with server: tsig verify failure

Reply from update query:

;; ->>HEADER<<- opcode: UPDATE, status: NOTAUTH, id:  35864

;; flags: qr ; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1

;; ZONE SECTION:

;local.                         IN      SOA

;; TSIG PSEUDOSECTION:

.                       0       ANY     TSIG    . 1130588923 300 0  35864 BADKEY 0

Reply from SOA query:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  41854

;; flags: qr rd ra ; QUESTION: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;239.                           IN      SOA

;; AUTHORITY SECTION:

.                       0       IN      SOA     A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2005102801 1800 900 604800 86400

Found zone name: .

The master is: A.ROOT-SERVERS.NET

before getaddrinfo()

; TSIG error with server: tsig verify failure

Reply from update query:

;; ->>HEADER<<- opcode: UPDATE, status: NOTAUTH, id:  10437

;; flags: qr ; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1

;; ZONE SECTION:

;0.168.192.in-addr.arpa.                IN      SOA

;; TSIG PSEUDOSECTION:

.                       0       ANY     TSIG    . 1130588923 300 0  10437 BADKEY 0
```

In /var/log/messages I see:

```
Oct 29 15:21:01 media kernel: process `nsupdate' is using obsolete setsockopt SO_BSDCOMPAT
```

Zone files stay is not updated  :Embarassed:  

```
media bind # cat pri/local.zone

$ORIGIN .

$TTL 3600      ; 1 day

local           IN SOA  ns.local. nsadmin.local. (

                        2005102902 ; serial

                        300        ; refresh (5 minutes)

                        900        ; retry (10 minutes)

                        604800     ; expire (1 week)

                        86400      ; minimum (1 day)

                        )

                NS      ns.local.

                A       192.168.0.254

$ORIGIN local.

$TTL 3600     ; 3 days 12 hours

ns              A       192.168.0.254
```

```
$ORIGIN .

$TTL 3600       ; 1 day

0.168.192.in-addr.arpa  IN SOA  ns.local root.local. (

                                2002081613 ; serial

                                300      ; refresh (3 hours)10800

                                900        ; retry (15 minutes)

                                604800     ; expire (1 week)

                                86400      ; minimum (1 day)

                                )

                        NS      ns.local

$ORIGIN 0.168.192.in-addr.arpa.

$TTL 3600       ; 3 days 12 hours
```

----------

## steveb

You try to update the "." zone?

```
Found zone name: .
```

cheers

SteveB

----------

## IRON

 *steveb wrote:*   

> You try to update the "." zone?
> 
> ```
> Found zone name: .
> ```
> ...

 

What you mean about update "." zone ? I didn't update this zone.

Do you have ICQ ?

----------

