<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I have a some devices that don't provide a hostname.  Dynamic DNS<br>
    doesn't get updated without a hostname.  I use:<br>
    <font color="#993300"><tt>#
------------------------------------------------------------------------------</tt><tt><br>
      </tt><tt>class "NoName" {</tt><tt><br>
      </tt><tt>        match if not (</tt><tt><br>
      </tt><tt>                exists server.ddns-hostname</tt><tt><br>
      </tt><tt>                or exists fqdn.hostname</tt><tt><br>
      </tt><tt>                or exists host-name</tt><tt><br>
      </tt><tt>        );</tt><tt><br>
      </tt><tt><br>
      </tt><tt>        ddns-hostname = concat("NoName-",
        binary-to-ascii(16, 8, "", substring(hardware, 4, 3)));</tt><tt><br>
      </tt><tt>        option dhcp.host-name = config-option
        server.ddns-hostname;</tt><tt><br>
      </tt><tt>#       option fqdn.hostname = config-option
        server.ddns-hostname;<br>
        }</tt><tt><br>
      </tt><tt>#
------------------------------------------------------------------------------</tt><tt><br>
      </tt></font>to create a hostname for them.  It uses the last 3
    bytes of the MAC address<br>
    as part of the host name.  Note: I'm using '<font color="#993300">option
      dhcp.host-name</font>' instead<br>
    of '<font color="#993300">option host-name</font>'.  I really don't
    know if that matters.  You might also<br>
    try '<font color="#993300">option fqdn.hostname</font>'.<br>
    <br>
    You can even confine them to a pool:<br>
    <font color="#993300"><tt>        pool {</tt><tt><br>
      </tt><tt>                deny dynamic bootp clients;</tt><tt><br>
      </tt><tt>                allow members of "NoName";   </tt><tt><br>
      </tt><tt>.</tt><tt><br>
      </tt><tt>.</tt><tt><br>
      </tt><tt>        }</tt></font><br>
    <br>
    HTH,<br>
    Bill<br>
    <br>
    <div class="moz-cite-prefix">On 6/23/2017 7:28 AM, Radoslav Pešek
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:b8af0147-6fc1-fef5-cb9d-f061a7a27db2@stuba.sk">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <p> </p>
      <div class="moz-text-html" lang="x-unicode">
        <div class="post-text" itemprop="text">
          <p>Hi all, <br>
          </p>
          <p>I sent this email few weeks ago (without being subscribed
            here), and didn't receive any reply, nor do I see it in
            lists archive. So I write once again after subscription,
            hope it will work now.<br>
          </p>
          <p>~~~~<br>
          </p>
          <p>My isc dhcp server behaves strangely - it sends some
            clients dhcp hostname option value which I don't know where
            it is getting it from.</p>
          <p>It's on Debian 8.5, version 4.3.1. It's in failover mode.</p>
          <p>I'm using dynamic hostname generation for some clients
            based on last byte of their mac address:</p>
          <pre><code>set mac_6 = suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 6, 1))), 2);
ddns-hostname = concat("vm1", mac_6);
option host-name = config-option server.ddns-hostname;
</code></pre>
          <p>So for example client with mac address ending 02 should get
            hostname vm102 - and it seems to work correctly - I added
            logging to my dhcp config and I see in log file both option
            host-name and config-option server.ddns-hostname set to
            vm102. </p>
          <p>I also see in dhcpd.leases </p>
          <pre><code>set mac_6 = "02";
client-hostname "vm102";
</code></pre>
          <p>But when I run tcpdump for this client, I see</p>
          <p><code>Hostname Option 12, length 5: "vm121" </code></p>
          <p>and at least once it changed to vm103.</p>
          <p>So where is it getting it from? What are the sources for
            this option when dhcp server sends DHCPOFFER or DHCPACK?</p>
          <p>It works after dhcp server restart, but then it starts
            again after a whlie.</p>
          <p>I tried to read isc-dhcp-server's source code but got bit
            lost as it was hard to follow.</p>
          <p>Thanks for any help.</p>
          <p>Rado.</p>
          <p><br>
          </p>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
dhcp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>