[Samba] kaa supported? ISC DHCP update DNS records: garbages in dhcp.leases in case on expiry/on release

Franta Hanzlik franta at hanzlici.cz
Sat Aug 24 10:33:23 UTC 2024


Please, is possible to do DNS updates with ISC kaa or another dhcp daemon?

Why am I asking? Because ISC dhcpd (not supported for two years now) - for
me version isc-dhcpd-4.4.3-P1 on Fedora 40 x86_64) seems to have problems
with crazy file bloat if some commands (especially log concat) are used
in event directives "on release" and/or "on expiry" - it seems that
the commands of these events dhcpd try to save to the dhcpd.leases file
and this can cause them to grow a lot, while the file itself can contain
nonsense.

What is interesting is that file verification (dhcpd -T) passes without 
error on such a file full of nonsense.

Probably the same problem is also described on the Zentyal forum: 
https://forum.zentyal.org/index.php?topic=35695.0

my example (based on the page 
https://wiki.samba.org/index.php/Configure_DHCP_to_update_DNS_records ):

1) "on expire" and "on exit" only contain the execute command.
The dhcpd.leases file entry then looks something like this:

lease 192.168.17.10 {
   starts 6 2024/08/24 10:14:26;
   ends 6 2024/08/24 11:14:26;
   cltt 6 2024/08/24 10:14:26;
   binding state active;
   next binding state free;
   rewind binding state free;
   hardware ethernet 88:a1:20:56:07:36;
   uid "\001\210\241 V\0076";
   set ClientName = "dhcp-192-168-17-10";
   set ClientDHCID = "88:a1:20:56:07:36";
   set ClientIP = "192.168.17.10";
   set noname = "dhcp-192-168-17-10";
   set vendor-class-identifier = "android-dhcp-9";
   on expiry {
     set ClientIP =
        binary-to-ascii (10, 8, ".", leased-address) ;
     execute ("/usr/local/bin/dhcp-ad-dyndns.sh", "delete", ClientIP, "", 
"0");
   }
   on release {
     set ClientIP =
        binary-to-ascii (10, 8, ".", leased-address) ;
     execute ("/usr/local/bin/dhcp-ad-dyndns.sh", "delete", ClientIP, "9");
   }
}


2) "on expire" and "on exit" also contain a log command:
lease 192.168.1.253 {
   starts 5 2024/08/23 18:01:57;
   ends 5 2024/08/23 19:01:57;
   cltt 5 2024/08/23 18:01:57;
   binding state active;
   next binding state free;
   rewind binding state free;
   hardware ethernet 88:a1:20:56:07:36;
   uid "\001\210\241 V\0076";
   set vendor-class-identifier = "android-dhcp-9";
   set noname = "dhcp-192-168-1-253";
   set ClientIP = "192.168.1.253";
   set ClientDHCID = "88:a1:20:56:07:36";
   set ClientName = "dhcp-192-168-1-253";
   set isst = "dynamic";
   on expiry {
     set ClientIP =
        binary-to-ascii (10, 8, ".", leased-address) ;
     set ClientDHCID =
        concat (concat (concat (concat (concat (concat (concat (concat 
(concat (
                                                                             
    concat
                                                                             
   (
                                                                             
  suffix
                                                                             
   (
                                                                             
  concat
                                                                             
   (
                                                                             
  "0",


                                                                             
  binary-to-ascii
                                                                             
   (16
                                                                             
  ,
                                                                             
  8,
                                                                             
  ""
                                                                             
  ,

                                                                             
  substring
                                                                             
   (
                                                                             
  hardware,
                                                                             
  1,
                                                                             
  1)
                                                                             
  ))
                                                                             
  ,
                                                                             
  2)
                                                                             
  ,
                                                                             
    ":")
                                                                             
    ,

                                                                             
    suffix
                                                                             
   (
                                                                             
  concat
                                                                             
   (
                                                                             
  "0",


                                                                             
  binary-to-ascii
                                                                             
   (16
                                                                             
  ,
                                                                             
  8,
                                                                             
  ""
                                                                             
  ,

                                                                             
  substring
                                                                             
   (
                                                                             
  hardware,
                                                                             
  2,
                                                                             
  1)
                                                                             
  ))
                                                                             
  ,
                                                                             
  2)
                                                                        ), 
":"),

                                                                suffix 
(concat (
                                                                             
    "0",
... (cca 400 similar garbage lines)

-- 
Thanks, Franta Hanzlik



More information about the samba mailing list