[Dnsmasq-discuss] dhcp.leases file format?
simon at thekelleys.org.uk
Wed Apr 26 07:31:19 BST 2006
William Trenker wrote:
> I'm running dnsmasq v2.27 and have been googling around trying to find
> a definition for the dhcp.leases file.
> Most of the fields are self explanatory. Here's an live example to
> illustrate a couple of questions:
> root at OpenWrt:~# cat /var/dhcp.leases
> 946689575 00:00:00:00:00:05 192.168.1.155 wdt 01:00:00:00:00:00:05
> 946689522 00:00:00:00:00:04 192.168.1.237 * 01:00:00:00:00:00:04
> 946689351 00:0f:b0:3a:b5:0b 192.168.1.208 colinux *
> 946689493 02:0f:b0:3a:b5:0b 192.168.1.199 * 01:02:0f:b0:3a:b5:0b
> The second column is obviously the MAC address. What is the last column?
> What are the asterisks in entries 2 and 4? The first two entries are
> from the same machine, I simply changed to MAC address from
> 00:00:00:00:00:04 to 00:00:00:00:00:05 in order to observe the
> results. I see that the 2nd entry has an asterisk instead of my
> computer's host name.
Fields in order.
1) Time of lease expiry, in epoch time (seconds since 1970). BTW you
seem to be living in the past: most of us are well past 1000000000
seconds by now :-) . There are compile time options in dnsmasq which
convert this field to be remaining lease time (in seconds) or, in the
most recent releases, total lease renewal time.
2) MAC address.
3) IP address.
4) Computer name, if known. This is always unqualified (no domain part)
5) Client-ID, if known. The client-ID is used as the computer's
unique-ID in preference to the MAC address, if it's available. Some DHCP
clients provide it, and some don't. The ones that do normally derive it
from the MAC address unless explicity configured, but it could be
something like a serial number, which would protect a computer from
losing its identify if the network interface were replaced.
The order of the lines has no significance, and will change over time.
The reason that only one of 00:....:04 and 00:...:05 have a name is that
only one lease can own a name, when 00:...:05 took a lease, claiming to
be wdt, it stole the name from 00:..:04
More information about the Dnsmasq-discuss