mac ddns for wake on lan

Stulic,Damjan damjan.stulic at
Mon Dec 17 18:16:02 UTC 2007

You can do something like this:
 pool {

   set MAC = pick ( binary-to-ascii (16, 8, "", substring(hardware, 1,
6) , "undefined" );
   ddns-hostname = MAC;

If you decide to keep original hostname, you can log the mac and use
some kind of swatch/syslog-ng process to trigger different events
(updates to dns). Like (in pool declaration):
   on commit {
     log(error, concat ("mac ",NAM);

Instead, I suggest that you look into OMAPI and use it to communicate to
server directly and get mac address that way!

Damjan Stulic
IS Security Identity Management
Edward Jones

 If you are not the intended recipient of this message (including attachments), or if you have received this message in error, immediately notify us and delete it and any attachments.  If you no longer wish to receive e-mail from Edward Jones, please send this request to messages at  You must include the e-mail address that you wish not to receive e-mail communications.  For important additional information related to this e-mail, visit
-----Original Message-----

From: dhcp-users-bounce at [mailto:dhcp-users-bounce at] On
Behalf Of Carl Karsten
Sent: Monday, December 17, 2007 08:34
To: dhcp-users at
Subject: mac ddns for wake on lan

I want to be able to use Wake On Lan without having to remember mac
So I was thinking I could add mac to the ddns update that dhcpd does.
maybe add 
a TXT record each time, and then the WOL program can get the mac from a
dns query.

How doable is this?  Looking at my dhcpd.conf I have no idea where to

Carl K

# dhcpd.conf
# Dynamic DNS - update the server
ddns-updates on;
ddns-update-style interim;
do-forward-updates on;
ddns-domainname "";
ddns-rev-domainname "";
update-static-leases on;
# ddns-ttl 7200;

         algorithm HMAC-MD5.SIG-ALG.REG.INT;
         secret ZiO1XpvhIDVLRsvnBk9+Qw==;

zone {
         primary localhost;
         key DHCP_UPDATER;

zone {
         primary localhost;
          key DHCP_UPDATER;

The data that is contained in a Magic Packet is the defined constant as
represented in hexadecimal: FF FF FF FF FF FF followed by sixteen
repetitions of the target computer's MAC address, possibly followed
by a four or six byte password.

import socket, sys

def wake_on_lan(ether_addr):

   s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
   s.sendto(msg, ('<broadcast>', 9))


More information about the dhcp-users mailing list