Keep hosts Mac address
Prunk Dump
prunkdump at gmail.com
Thu Dec 5 12:22:13 UTC 2013
2013/12/4 David Forrest <drf at maplepark.com>:
> On Wed, 4 Dec 2013, Prunk Dump wrote:
>
>> Hello,
>>
>> I'm looking for a way to keep my hosts mac address in a database so I
>> can power on them using their WOL capability. The DHCP server seems a
>> good starting point to do this because it give or query the host-names
>> and manages the leases with the mac addresses.
>
> ...
>
>> Can anyone give me an idea ?
>
>
> I use dhcp logging. From my current dhcpd.conf:
>
> ##### new lease issued logging
> on commit { if (static) {
> log (info, concat (
> "DHCPNETMON ",
> binary-to-ascii (10,32,"",encode-int (lease-time,32))," ",
> substring (binary-to-ascii (16,8,":",hardware), 2,17)," ",
> binary-to-ascii (10,8,".",leased-address)," ",
> pick-first-value(host-decl-name, "(none)"),
> " static"));
> } else {
> log (info, concat (
> "DHCPNETMON ",
> binary-to-ascii (10,32,"",encode-int (lease-time,32))," ",
> substring (binary-to-ascii (16,8,":",hardware), 2,17)," ",
> binary-to-ascii (10,8,".",leased-address), " ",
> pick-first-value(ddns-fwd-name,host-decl-name,host-name,"(none)"),
> " dynamic"));
> }
>
> and looking at the log file, it appears this might then work for you:
> $ sudo grep DHCPNETMON /var/log/messages |cut -d \ -f 9,10|sort|uniq
> 0:c0:a8:da:94:35 192.168.102.126
> 28:ef:1:48:89:64 192.168.102.129
> 52:54:0:ae:45:1d 192.168.102.118
> ec:9a:74:94:68:64 192.168.102.127
> $
>
>
> Dave
> --
> David Forrest e-mail drf at maplepark.com
> Maple Park Development http://www.maplepark.com
> St. Louis, Missouri
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
Thanks !
This is exactly what I want ! But I need to keep the built-in version
of the DNS update. In the documentation It is say to copy the script
of the top of the server/dhcpd.c file in the commit event. But I can
read this in the source code :
/* This stuff is always executed to figure the default values for certain
ddns variables. */
char std_nsupdate [] = " \n\
option server.ddns-hostname = \n\
pick (option fqdn.hostname, option host-name); \n\
option server.ddns-domainname = config-option domain-name; \n\
option server.ddns-rev-domainname = \"in-addr.arpa.\";";
/* This is the old-style name service updater that is executed
whenever a lease is committed. It does not follow the DHCP-DNS
draft at all. */
char old_nsupdate [] = " \n\
on commit {
...
....
....}
"
The comments say that is the old style DNS updater. This means that it
will not be executed ? I need to copy this old_nsupdate code ? Will
this change the built-in DDNS behavior ?
Where can I find a example configuration file ?
Thanks !
PELLEGRIN Baptiste.
More information about the dhcp-users
mailing list