mac ddns for wake on lan

Stulic,Damjan damjan.stulic at edwardjones.com
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 edwardjones.com.  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 www.edwardjones.com/US_email_disclosure
 
-----Original Message-----
 

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

I want to be able to use Wake On Lan without having to remember mac
addresses. 
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
start.

Carl K

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

key DHCP_UPDATER {
         algorithm HMAC-MD5.SIG-ALG.REG.INT;
         secret ZiO1XpvhIDVLRsvnBk9+Qw==;
        };

zone personnelware.com. {
         primary localhost;
         key DHCP_UPDATER;
        }

zone 1.168.192.in-addr.arpa. {
         primary localhost;
          key DHCP_UPDATER;
        }


# wol.py
"""
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):
   hw_addr=ether_addr.replace(':','').decode('hex')
   msg='\xff'*6+hw_addr*16

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

wake_on_lan(sys.argv[1])


More information about the dhcp-users mailing list