I have a voyage 2.6.38 machine running DNSMASQ for a DHCP server and I would like to get the hostnames of the clients that acquire DHCP leases. How would I go about doing this?
If the host sends its name you can retrieve it from DNS. If you know its IP address you just do a reverse lookup on the IP address. One of these commands should work (use the host's IP address in place of 126.96.36.199):
You can retrieve a list of all leases including the name provided if any from your
The fields in the leasefile are timestamp, mac address, ip address, hostname, and client id. The client is not required to send a hostname or client id.
If logging has been enabled, you can look at the syslog to see which leases have been negotiated. All DHCP negotiations should be logged. If you have long lease times, the negotiations will be not be frequent. Clients should start negotiating a renewal at half the lease time. It is best to set the lease time at least twice the period you can reasonably expect your DHCP server to be down.
It's upto the client whether it wants to send them. In the initial request it can be configured to send the hostname. Most desktop/server DHCP clients do this embedded one often do not.