Linux – Use wakeonlan by hostname rather than MAC/IP

binddhcplinuxUbuntuwake-on-lan

I'm setting up a cluster and can wake up individual machines with the command

wakeonlan -i 192.168.1.255 [MAC Address]

I'd like to be able to do this by hostname instead of MAC, but the config file for wakeonlan only seems to offer IP <-> MAC mapping. How can I do it by hostname?

If it helps, I'm running DHCP3 + BIND and have entered all the machines MAC addresses in the dhcpd.conf file so that they get sent the correct hostname when PXEbooting.

Perhaps there is some command like 'host' that would give me a MAC from a hostname?

Thanks

Best Answer

See man 5 ethers; basically, put MAC / hostname pairs in your /etc/ethers. Then etherwake will be able to wake them.