[Dnsmasq-discuss] hosts with non-unique dhcp client ids

Matt Ginzton matt at ginzton.net
Mon Nov 28 06:15:16 GMT 2011


Hi,

I'm a very happy dnsmasq user, with one question: is there a way to ensure all clients get hostnames, even if the client id they request can't be used as the hostname?

I like looking at the dhcp clients list (which is saved in /tmp/dhcp.leases on my router) once in a while to verify I recognize all the machines on my network. It's easy to verify the ones which use reasonable and unique values for their dhcp client id (and I realize this is spoofable and shouldn't be relied on for security purposes -- it's good enough for my purposes), but a lot of hosts show up with just an asterisk for their client id, and thus get no hostname.

In addition to being hard to recognize in the list of clients, it also means they don't get hostnames -- all of this makes debugging the occasional network problem more difficult. So I'd be happier if I could ensure that all the clients on the network get unique and reasonable hostnames, even if they don't supply reasonable client ids. (I think dnsmasq uses "*" as the hostname when the client id is either not supplied, or not unique. One example of this is Sonos gear -- I have several Sonos ZonePlayers, and they apparently all use "SonosZP" as their client id, so the first one gets that as its hostname, and the rest don't get hostnames.)

I'm just curious if dnsmasq offers a way to deal with such clients. Looking over the sample dnsmasq.conf the best thing that jumps out at me is this form of the dhcp-host option:

# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred

so I could hardcode names for all the ill-behaved hosts on my network. Good idea, bad idea; is there a better way? Is there an option to assign unique hostnames by adding, say, a unique numeric suffix if multiple hosts request addresses using the same client id?

thanks,

Matt




More information about the Dnsmasq-discuss mailing list