[Dnsmasq-discuss] dhcp.leases file format?

William Trenker wtrenker at gmail.com
Wed Apr 26 23:52:48 BST 2006


Hello Simon,

On 4/25/06, Simon Kelley <simon at thekelleys.org.uk> wrote:
> William Trenker wrote:
> > Hello,
> >
> > I'm running dnsmasq v2.27 and have been googling around trying to find
> > a definition for the dhcp.leases file.

<snip>

Thanks for the very helfpul and timely answer.  I should have
mentioned that my interest in the dhcp.leases file is that I'm trying
to find a way to force an expiration.  I was thinking perhaps I could
simply remove the relevant line from the dhcp.leases file.  But of
course I should have asked if that would even work.

Thanks again,

Bill

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

> > 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
>
> HTH
>
> Simon.
>
>
>
>
>
>



More information about the Dnsmasq-discuss mailing list