<html><body><div style="font-family: Andale Mono; font-size: 10pt; color: #000000"><div style="font-family: Andale Mono; font-size: 10pt; color: #000000">Robert,</div><div style="font-family: Andale Mono; font-size: 10pt; color: #000000"><br data-mce-bogus="1"></div><div style="font-family: Andale Mono; font-size: 10pt; color: #000000">I don't know anything about DDNS updates as I have never used them, but I can confirm that on release {} in DHCPv6 does not seem to have access to any of the option data.  I had the same problem and asked the list about it more than a week ago.  I was met with silence.  If a developer could comment on this being a bug or simply not implemented yet, that would be great.  Target for inclusion of option data in on release {} statements?<br><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Robert Senger" <robert.senger@lists.microscopium.de><br><b>To: </b>"Users of ISC DHCP" <dhcp-users@lists.isc.org><br><b>Sent: </b>Friday, December 2, 2016 10:01:31 AM<br><b>Subject: </b>Issues with dhcpv6 and ddns updates<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">Hi there,<br><br>I am running isc-dhcp-server in ipv6 mode, and I'd like to update the<br>local internal dns zones hosted by bind9 with dhcpv6 client's names and<br>ipv6 addresses.<br><br>The built-in ddns seems to be completely unable to remove entries from<br>the dns upon expiry or release, so I ended up doing ddns stuff on my<br>own using "on commit|expiry|release" event handlers and corresponding<br>scripts.<br><br>But this also has issues with expiry and release events. While<br>(almost...) everything is fine with commits, I am having trouble<br>getting enough information about which hosts lease has expired or was<br>released.<br><br>This is the code I have in the dhcpd6.conf global scope:<br><br>on commit<br>{                                                                      <br>                                                              <br>        set ClientMac =<br>"n/a";                                                                 <br>                                                <br>        set ClientIP = pick-first-value(binary-to-ascii(16, 16, ":",<br>substring(option dhcp6.ia-na, 16, 16)),<br>"n/a");                           <br>        set ClientID = pick-first-value(binary-to-ascii(16, 8, ":",<br>option dhcp6.client-id),<br>"n/a");                                           <br>        set ClientName = pick-first-value(ddns-hostname, option<br>fqdn.hostname, option host-name,<br>"n/a");                                       <br>        log(concat("Commit (global): Mac: ", ClientMac, ", IP: ",<br>ClientIP, ", Name: ", ClientName, ", ID: ",<br>ClientID));                      <br>        #execute("/etc/dhcp/dhcp6commit.sh", ClientMac, ClientIP,<br>ClientName,<br>ClientID);                                                       <br>}                                                                      <br>                                                                       <br> <br>on expiry<br>{                                                                      <br>                                                              <br>        set ClientMac =<br>"n/a";                                                                 <br>                                                <br>        set ClientIP = pick-first-value(binary-to-ascii(16, 16, ":",<br>substring(option dhcp6.ia-na, 16, 16)),<br>"n/a");                           <br>        set ClientID = pick-first-value(binary-to-ascii(16, 8, ":",<br>option dhcp6.client-id),<br>"n/a");                                           <br>        set ClientName = pick-first-value(ddns-hostname, option<br>fqdn.hostname, option host-name,<br>"n/a");                                       <br>        log(concat("Expiry (global): Mac: ", ClientMac, ", IP: ",<br>ClientIP, ", Name: ", ClientName, ", ID: ",<br>ClientID));                      <br>        #execute("/etc/dhcp/dhcp6expiry.sh", ClientMac, ClientIP,<br>ClientName,<br>ClientID);                                                       <br>}                                                                      <br>                                                                       <br> <br>on release<br>{                                                                      <br>                                                             <br>        set ClientMac =<br>"n/a";                                                                 <br>                                                <br>        set ClientIP = pick-first-value(binary-to-ascii(16, 16, ":",<br>substring(option dhcp6.ia-na, 16, 16)),<br>"n/a");                           <br>        set ClientID = pick-first-value(binary-to-ascii(16, 8, ":",<br>option dhcp6.client-id),<br>"n/a");                                           <br>        set ClientName = pick-first-value(ddns-hostname, option<br>fqdn.hostname, option host-name,<br>"n/a");                                       <br>        log(concat("Release (global): Mac: ", ClientMac, ", IP: ",<br>ClientIP, ", Name: ", ClientName, ", ID: ",<br>ClientID));                     <br>        #execute("/etc/dhcp/dhcp6release.sh", ClientMac, ClientIP,<br>ClientName,<br>ClientID);                                                      <br>}                                                                      <br>                                                                       <br><br>(I've commented the "execute" statement to not mess up ddns while<br>testing).<br><br>And this is what I see in the dhcp log:<br><br>Commit:<br><br>Dec  2 15:02:02 prokyon dhcpd: Reply NA: address<br>fd10:2842:f0d1:414:b64e:8a55:154d:ad6 to client with duid<br>00:01:00:01:1e:dd:f7:4d:00:12:f0:90:5a:49 iaid = 1 valid for 1200<br>seconds<br>Dec  2 15:02:02 prokyon dhcpd: Commit (global): Mac: n/a, IP:<br>fd10:2842:f0d1:414:b64e:8a55:154d:ad6, Name: n/a, ID:<br>0:1:0:1:1e:dd:f7:4d:0:12:f0:90:5a:49<br><br>Release:<br><br>Dec  2 15:03:39 prokyon dhcpd: Client<br>00:01:00:01:1e:dd:f7:4d:00:12:f0:90:5a:49 releases address<br>fd10:2842:f0d1:414:b64e:8a55:154d:ad6<br>Dec  2 15:03:39 prokyon dhcpd: Release (global): Mac: n/a, IP: n/a,<br>Name: n/a, ID: n/a<br><br>Expiry:<br><br>Dec  2 15:14:04 prokyon dhcpd: Expiry (global): Mac: n/a, IP: n/a,<br>Name: n/a, ID: n/a<br><br>So, everything is alright for commit events, except that there's no<br>hostname available. I know how to create a custom hostname from address<br>or id, so this is not really a problem.<br><br>But for expiry and release events, there's simply nothing that can be<br>passed on to the scripts. No address, no name, no id. It's impossible<br>to remove dns entries. <br><br><br>Next, if I move the "set ClientIP = " lines from inside the "on<br>commit|expiry|release" event handlers above those into the global<br>scope, I magically get the address for expiry, but not for release:<br><br>Dec  2 15:35:55 prokyon dhcpd: Expiry (global): Mac: n/a, IP:<br>fd10:2842:f0d1:414:b64e:8a55:154d:ad6, Name: n/a, ID: n/a<br>Dec  2 15:38:17 prokyon dhcpd: Release (global): Mac: n/a, IP: n/a,<br>Name: n/a, ID: n/a<br><br><br>Moving all this code into a host statement (works for known hosts only,<br>of course), finally makes it possible to get a hostname and to perform<br>clean ddns updates for commit and expiry, but it requires at least one<br>dns lookup in the script to get the address from the hostname for<br>release events, which is a really, really ugly hack. <br><br>Am I doing something wrong, did I miss something, or ist this<br>intended behavior or even a bug?<br><br>Thanks for help,<br><br>Robert<br><br><br>-- <br>Robert Senger<br><br><br>-- <br>Robert Senger<br><br><br><br>_______________________________________________<br>dhcp-users mailing list<br>dhcp-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/dhcp-users</blockquote></div></div><br></div></body></html>