[bind10-dev] Random musing: DNS server support for standby devices?

Shane Kerr shane at isc.org
Wed Mar 16 08:32:58 UTC 2011


All,

[ This idea may already be implemented, but 5 minutes of Google didn't 
  find anything. ]

I was setting up an old box to act as a print server last night(*). I
was thinking it would be nice to be able to use wake-on-LAN (WOL) to
turn it on right before it was needed. This would also be useful for any
device that is not used for part of the time, like a backup server.

So what I was thinking might be nice is if the DNS server would notice
when someone is looking for a WOL device and would send the magic
wake-up packet on behalf of the user. It would act as a kind of proxy.

It might even be able to delay the DNS answer by a few seconds to give
the device time to wake up. To go even further, the DNS server could
ping the device in advance so that it could know whether it needed
wakeup at all (or perhaps do this periodically).

So, the idea is something like this:

query = receive_query()
answer = lookup_answer(query)
host = host_in_answer(answer)        # A or AAAA
if is_wol_host(host) and client_can_wol(query):
    pingable = ping_wol_host(host)   # small timeout... 50 msec or so
    if not pingable:
        send_magic_packet(host)
        timeout = time.now() + 3 second
        while not pingable and (time.now() < timeout):
            pingable = ping_wol_host(host)   # bigger timeout, 250 msec?
            send_magic_packet(host)
send_answer(answer)


Apple has something like this for their zeroconf stuff, but that is for
Bonjour (multicast DNS):

http://en.wikipedia.org/wiki/Apple_Sleep_Proxy_Service_%28Bonjour_Sleep_Proxy%29

Anyway, this is something we (I) may want to hack together using the
hooks once we have them. :)
        
--
Shane

(*) Yes I am too cheap to get a network printer. My old printer still 
    works!




More information about the bind10-dev mailing list