[Dnsmasq-discuss] client name via DHCP

Helmut Hullen Hullen at t-online.de
Fri Feb 11 10:23:00 GMT 2011


Hallo, Simon,

Du meintest am 10.02.11:

>>>>>> when I use the ISC DHCP, then I can see the name of the Windows
>>>>>> client in "/var/state/dhcp/dhcp.leases".
>>>>>>
>>>>>> With dnsmasq as DNS and DHCP server I haven't found this feature
>>>>>> - is it somewhere hidden?

>> [...]

>> The client's own name is "KB-PC", dnsmasq reads "Client-A60" from a
>> list on the server (which is completely independent from the "real"
>> client's name).
>>
>> I want to see the "real" client's name, it's a better help for
>> guessing who's the owner of the machine.
>>

> So you want the hostname the client sends to the DHCP server, which
> is not used by dnsmasq because it's overridden by on-the-server
> configuration? That is available: it's set in the environment
> variable DNSMASQ_SUPPLIED_HOSTNAME given to the lease-change script.
> (All the environment variables are prefixed with DNSMASQ_, it really
> is the client's idea of the hostname, not dnsmasq's.

> Writing a little script which logs this and the dnsmasq hostname, MAC
> address, IP address or anything else useful should give you a file
> which can be searched.

Sounds simple ... but when can I (or my script) see  
"DNSMASQ_SUPPLIED_HOSTNAME"?

If I've understood managing environment variables right then this  
variable is only valid within (and under) "dnsmasq".

ISC-DHCP tells "client-hostname" in many log lines:

Feb 11 11:05:01 Arktur dhcpd: DHCPOFFER on 192.168.0.186 to  
00:21:97:10:9c:16 (WPR-PC) via eth0
Feb 11 11:05:04 Arktur dhcpd: DHCPDISCOVER from 00:21:97:10:9c:16 (WPR-PC) via
eth0
Feb 11 11:05:04 Arktur dhcpd: DHCPOFFER on 192.168.0.186 to 00:21:97:10:9c:16
(WPR-PC) via eth0
Feb 11 11:05:12 Arktur dhcpd: DHCPDISCOVER from 00:21:97:10:9c:16 (WPR-PC) via
eth0
Feb 11 11:05:12 Arktur dhcpd: DHCPOFFER on 192.168.0.186 to 00:21:97:10:9c:16
(WPR-PC) via eth0
Feb 11 11:05:12 Arktur dhcpd: DHCPREQUEST for 192.168.0.186 (192.168.0.1) from
00:21:97:10:9c:16 (WPR-PC) via eth0
Feb 11 11:05:12 Arktur dhcpd: DHCPACK on 192.168.0.186 to 00:21:97:10:9c:16 (WPR-PC) via eth0

----------------

I'd be pleased if/when "dnsmasq" tells the client's hostname at least in  
one of its log messages.

Viele Gruesse!
Helmut



More information about the Dnsmasq-discuss mailing list