1dhcpd.leases(5) File Formats Manual dhcpd.leases(5)
2
3
4
6 dhcpd.leases - DHCP client lease database
7
9 The Internet Systems Consortium DHCP Server keeps a persistent database
10 of leases that it has assigned. This database is a free-form ASCII
11 file containing a series of lease declarations. Every time a lease is
12 acquired, renewed or released, its new value is recorded at the end of
13 the lease file. So if more than one declaration appears for a given
14 lease, the last one in the file is the current one.
15
16 When dhcpd is first installed, there is no lease database. However,
17 dhcpd requires that a lease database be present before it will start.
18 To make the initial lease database, just create an empty file called
19 /var/lib/dhcpd/dhcpd.leases. You can do this with:
20
21 touch /var/lib/dhcpd/dhcpd.leases
22
23 In order to prevent the lease database from growing without bound, the
24 file is rewritten from time to time. First, a temporary lease data‐
25 base is created and all known leases are dumped to it. Then, the old
26 lease database is renamed /var/lib/dhcpd/dhcpd.leases~. Finally, the
27 newly written lease database is moved into place.
28
29 In order to process both DHCPv4 and DHCPv6 messages you will need to
30 run two separate instances of the dhcpd process. Each of these
31 instances will need it's own lease file. You can use the -lf option on
32 the server's command line to specify a different lease file name for
33 one or both servers.
34
36 Lease descriptions are stored in a format that is parsed by the same
37 recursive descent parser used to read the dhcpd.conf(5) and
38 dhclient.conf(5) files. Lease files can contain lease declarations,
39 and also group and subgroup declarations, host declarations and
40 failover state declarations. Group, subgroup and host declarations are
41 used to record objects created using the OMAPI protocol.
42
43 The lease file is a log-structured file - whenever a lease changes, the
44 contents of that lease are written to the end of the file. This means
45 that it is entirely possible and quite reasonable for there to be two
46 or more declarations of the same lease in the lease file at the same
47 time. In that case, the instance of that particular lease that
48 appears last in the file is the one that is in effect.
49
50 Group, subgroup and host declarations in the lease file are handled in
51 the same manner, except that if any of these objects are deleted, a
52 rubout is written to the lease file. This is just the same declara‐
53 tion, with { deleted; } in the scope of the declaration. When the
54 lease file is rewritten, any such rubouts that can be eliminated are
55 eliminated. It is possible to delete a declaration in the dhcpd.conf
56 file; in this case, the rubout can never be eliminated from the
57 dhcpd.leases file.
58
60 While the lease file formats for DHCPv4 and DHCPv6 are different they