OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / dhcp / original / man5 / dhcpd.conf.5
1 .\"     dhcpd.conf.5
2 .\"
3 .\" Copyright (c) 1996-2001 Internet Software Consortium.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\"
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of The Internet Software Consortium nor the names
14 .\"    of its contributors may be used to endorse or promote products derived
15 .\"    from this software without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
18 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 .\" DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
22 .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\" This software has been written for the Internet Software Consortium
32 .\" by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
33 .\" To learn more about the Internet Software Consortium, see
34 .\" ``http://www.isc.org/''.  To learn more about Vixie Enterprises,
35 .\" see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
36 .\" ``http://www.nominum.com''.
37 .TH dhcpd.conf 5
38 .SH NAME
39 dhcpd.conf - dhcpd configuration file
40 .SH DESCRIPTION
41 The dhcpd.conf file contains configuration information for
42 .IR dhcpd,
43 the Internet Software Consortium DHCP Server.
44 .PP
45 The dhcpd.conf file is a free-form ASCII text file.   It is parsed by
46 the recursive-descent parser built into dhcpd.   The file may contain
47 extra tabs and newlines for formatting purposes.  Keywords in the file
48 are case-insensitive.   Comments may be placed anywhere within the
49 file (except within quotes).   Comments begin with the # character and
50 end at the end of the line.
51 .PP
52 The file essentially consists of a list of statements.   Statements
53 fall into two broad categories - parameters and declarations.
54 .PP
55 Parameter statements either say how to do something (e.g., how long a
56 lease to offer), whether to do something (e.g., should dhcpd provide
57 addresses to unknown clients), or what parameters to provide to the
58 client (e.g., use gateway 220.177.244.7).
59 .PP
60 Declarations are used to describe the topology of the
61 network, to describe clients on the network, to provide addresses that
62 can be assigned to clients, or to apply a group of parameters to a
63 group of declarations.   In any group of parameters and declarations,
64 all parameters must be specified before any declarations which depend
65 on those parameters may be specified.
66 .PP
67 Declarations about network topology include the
68  \fIshared-network\fR and the \fIsubnet\fR
69 declarations.   If clients on a subnet are to be assigned addresses
70 dynamically, a \fIrange\fR declaration must appear within the
71 \fIsubnet\fR declaration.   For clients with statically assigned
72 addresses, or for installations where only known clients will be
73 served, each such client must have a \fIhost\fR declaration.   If
74 parameters are to be applied to a group of declarations which are not
75 related strictly on a per-subnet basis, the \fIgroup\fR declaration
76 can be used.
77 .PP
78 For every subnet which will be served, and for every subnet
79 to which the dhcp server is connected, there must be one \fIsubnet\fR
80 declaration, which tells dhcpd how to recognize that an address is on
81 that subnet.  A \fIsubnet\fR declaration is required for each subnet
82 even if no addresses will be dynamically allocated on that subnet.
83 .PP
84 Some installations have physical networks on which more than one IP
85 subnet operates.   For example, if there is a site-wide requirement
86 that 8-bit subnet masks be used, but a department with a single
87 physical ethernet network expands to the point where it has more than
88 254 nodes, it may be necessary to run two 8-bit subnets on the same
89 ethernet until such time as a new physical network can be added.   In
90 this case, the \fIsubnet\fR declarations for these two networks must be
91 enclosed in a \fIshared-network\fR declaration.
92 .PP
93 Some sites may have departments which have clients on more than one
94 subnet, but it may be desirable to offer those clients a uniform set
95 of parameters which are different than what would be offered to
96 clients from other departments on the same subnet.   For clients which
97 will be declared explicitly with \fIhost\fR declarations, these
98 declarations can be enclosed in a \fIgroup\fR declaration along with
99 the parameters which are common to that department.   For clients
100 whose addresses will be dynamically assigned, class declarations and
101 conditional declarations may be used to group parameter assignments
102 based on information the client sends.
103 .PP
104 When a client is to be booted, its boot parameters are determined by
105 consulting that client's \fIhost\fR declaration (if any), and then
106 consulting any \fIclass\fR declarations matching the client,
107 followed by the \fIpool\fR, \fIsubnet\fR and \fIshared-network\fR
108 declarations for the IP address assigned to the client.   Each of
109 these declarations itself appears within a lexical scope, and all
110 declarations at less specific lexical scopes are also consulted for
111 client option declarations.   Scopes are never considered
112 twice, and if parameters are declared in more than one scope, the
113 parameter declared in the most specific scope is the one that is
114 used.
115 .PP
116 When dhcpd tries to find a \fIhost\fR declaration for a client, it
117 first looks for a \fIhost\fR declaration which has a
118 \fIfixed-address\fR parameter which matches the subnet or shared
119 network on which the client is booting.   If it doesn't find any such
120 entry, it then tries to find an entry which has no \fIfixed-address\fR
121 parameter.
122 .SH EXAMPLES
123 .PP
124 A typical dhcpd.conf file will look something like this:
125 .nf
126
127 .I global parameters...
128
129 subnet 204.254.239.0 netmask 255.255.255.224 {
130   \fIsubnet-specific parameters...\fR
131   range 204.254.239.10 204.254.239.30;
132 }
133
134 subnet 204.254.239.32 netmask 255.255.255.224 {
135   \fIsubnet-specific parameters...\fR
136   range 204.254.239.42 204.254.239.62;
137 }
138
139 subnet 204.254.239.64 netmask 255.255.255.224 {
140   \fIsubnet-specific parameters...\fR
141   range 204.254.239.74 204.254.239.94;
142 }
143
144 group {
145   \fIgroup-specific parameters...\fR
146   host zappo.test.isc.org {
147     \fIhost-specific parameters...\fR
148   }
149   host beppo.test.isc.org {
150     \fIhost-specific parameters...\fR
151   }
152   host harpo.test.isc.org {
153     \fIhost-specific parameters...\fR
154   }
155 }
156
157 .ce 1
158 Figure 1
159
160 .fi
161 .PP
162 Notice that at the beginning of the file, there's a place
163 for global parameters.   These might be things like the organization's
164 domain name, the addresses of the name servers (if they are common to
165 the entire organization), and so on.   So, for example:
166 .nf
167
168         option domain-name "isc.org";
169         option domain-name-servers ns1.isc.org, ns2.isc.org;
170
171 .ce 1
172 Figure 2
173 .fi
174 .PP
175 As you can see in Figure 2, you can specify host addresses in
176 parameters using their domain names rather than their numeric IP
177 addresses.  If a given hostname resolves to more than one IP address
178 (for example, if that host has two ethernet interfaces), then where
179 possible, both addresses are supplied to the client.
180 .PP
181 The most obvious reason for having subnet-specific parameters as
182 shown in Figure 1 is that each subnet, of necessity, has its own
183 router.   So for the first subnet, for example, there should be
184 something like:
185 .nf
186
187         option routers 204.254.239.1;
188 .fi
189 .PP
190 Note that the address here is specified numerically.   This is not
191 required - if you have a different domain name for each interface on
192 your router, it's perfectly legitimate to use the domain name for that
193 interface instead of the numeric address.   However, in many cases
194 there may be only one domain name for all of a router's IP addresses, and
195 it would not be appropriate to use that name here.
196 .PP
197 In Figure 1 there is also a \fIgroup\fR statement, which provides
198 common parameters for a set of three hosts - zappo, beppo and harpo.
199 As you can see, these hosts are all in the test.isc.org domain, so it
200 might make sense for a group-specific parameter to override the domain
201 name supplied to these hosts:
202 .nf
203
204         option domain-name "test.isc.org";
205 .fi
206 .PP
207 Also, given the domain they're in, these are probably test machines.
208 If we wanted to test the DHCP leasing mechanism, we might set the
209 lease timeout somewhat shorter than the default:
210
211 .nf
212         max-lease-time 120;
213         default-lease-time 120;
214 .fi
215 .PP
216 You may have noticed that while some parameters start with the
217 \fIoption\fR keyword, some do not.   Parameters starting with the
218 \fIoption\fR keyword correspond to actual DHCP options, while
219 parameters that do not start with the option keyword either control
220 the behavior of the DHCP server (e.g., how long a lease dhcpd will
221 give out), or specify client parameters that are not optional in the
222 DHCP protocol (for example, server-name and filename).
223 .PP
224 In Figure 1, each host had \fIhost-specific parameters\fR.   These
225 could include such things as the \fIhostname\fR option, the name of a
226 file to upload (the \fIfilename parameter) and the address of the
227 server from which to upload the file (the \fInext-server\fR
228 parameter).   In general, any parameter can appear anywhere that
229 parameters are allowed, and will be applied according to the scope in
230 which the parameter appears.
231 .PP
232 Imagine that you have a site with a lot of NCD X-Terminals.   These
233 terminals come in a variety of models, and you want to specify the
234 boot files for each model.   One way to do this would be to have host
235 declarations for each server and group them by model:
236 .nf
237
238 group {
239   filename "Xncd19r";
240   next-server ncd-booter;
241
242   host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
243   host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; }
244   host ncd8 { hardware ethernet 0:c0:c3:22:46:81; }
245 }
246
247 group {
248   filename "Xncd19c";
249   next-server ncd-booter;
250
251   host ncd2 { hardware ethernet 0:c0:c3:88:2d:81; }
252   host ncd3 { hardware ethernet 0:c0:c3:00:14:11; }
253 }
254
255 group {
256   filename "XncdHMX";
257   next-server ncd-booter;
258
259   host ncd1 { hardware ethernet 0:c0:c3:11:90:23; }
260   host ncd4 { hardware ethernet 0:c0:c3:91:a7:8; }
261   host ncd8 { hardware ethernet 0:c0:c3:cc:a:8f; }
262 }
263 .fi
264 .SH ADDRESS POOLS
265 .PP
266 The
267 .B pool
268 declaration can be used to specify a pool of addresses that will be
269 treated differently than another pool of addresses, even on the same
270 network segment or subnet.   For example, you may want to provide a
271 large set of addresses that can be assigned to DHCP clients that are
272 registered to your DHCP server, while providing a smaller set of
273 addresses, possibly with short lease times, that are available for
274 unknown clients.   If you have a firewall, you may be able to arrange
275 for addresses from one pool to be allowed access to the Internet,
276 while addresses in another pool are not, thus encouraging users to
277 register their DHCP clients.   To do this, you would set up a pair of
278 pool declarations:
279 .PP
280 .nf
281 subnet 10.0.0.0 netmask 255.255.255.0 {
282   option routers 10.0.0.254;
283
284   # Unknown clients get this pool.
285   pool {
286     option domain-name-servers bogus.example.com;
287     max-lease-time 300;
288     range 10.0.0.200 10.0.0.253;
289     allow unknown clients;
290   }
291
292   # Known clients get this pool.
293   pool {
294     option domain-name-servers ns1.example.com, ns2.example.com;
295     max-lease-time 28800;
296     range 10.0.0.5 10.0.0.199;
297     deny unknown clients;
298   }
299 }
300 .fi
301 .PP
302 It is also possible to set up entirely different subnets for known and
303 unknown clients - address pools exist at the level of shared networks,
304 so address ranges within pool declarations can be on different
305 subnets.
306 .PP
307 As you can see in the preceding example, pools can have permit lists
308 that control which clients are allowed access to the pool and which
309 aren't.  Each entry in a pool's permit list is introduced with the
310 .I allow
311 or \fIdeny\fR keyword.   If a pool has a permit list, then only those
312 clients that match specific entries on the permit list will be
313 eligible to be assigned addresses from the pool.   If a pool has a
314 deny list, then only those clients that do not match any entries on
315 the deny list will be eligible.    If both permit and deny lists exist
316 for a pool, then only clients that match the permit list and do not
317 match the deny list will be allowed access.
318 .SH DYNAMIC ADDRESS ALLOCATION
319 Address allocation is actually only done when a client is in the INIT
320 state and has sent a DHCPDISCOVER message.  If the client thinks it
321 has a valid lease and sends a DHCPREQUEST to initiate or renew that
322 lease, the server has only three choices - it can ignore the
323 DHCPREQUEST, send a DHCPNAK to tell the client it should stop using
324 the address, or send a DHCPACK, telling the client to go ahead and use
325 the address for a while.
326 .PP
327 If the server finds the address the client is requesting, and that
328 address is available to the client, the server will send a DHCPACK.
329 If the address is no longer available, or the client isn't permitted
330 to have it, the server will send a DHCPNAK.  If the server knows
331 nothing about the address, it will remain silent, unless the address
332 is incorrect for the network segment to which the client has been
333 attached and the server is authoritative for that network segment, in
334 which case the server will send a DHCPNAK even though it doesn't know
335 about the address.
336 .PP
337 There may be a host declaration matching the client's identification,
338 and that host declaration contains a fixed-address declaration that is
339 valid for the network segment to which the client is connected.  In
340 this case, the DHCP server will never do dynamic address allocation.
341 In this case, the client is \fIrequired\fB to take the address
342 specified in the host declaration.   If the client is requesting some
343 other address, the server will respond with a DHCPNAK.
344 .PP
345 When the DHCP server allocates a new address for a client (remember,
346 this only happens if the client has sent a DHCPDISCOVER), it first
347 looks to see if the client already has a valid lease on an IP address,
348 or if there is an old IP address the client had before that hasn't yet
349 been reassigned.  In that case, the server will take that address and
350 check it to see if the client is still permitted to use it.  If the
351 client is no longer permitted to use it, the lease is freed if the
352 server thought it was still in use - the fact that the client has sent
353 a DHCPDISCOVER proves to the server that the client is no longer using
354 the lease.
355 .PP
356 If no existing lease is found, or if the client is forbidden to
357 receive the existing lease, then the server will look in the list of
358 address pools for the network segment to which the client is attached
359 for a lease that is not in use and that the client is permitted to
360 have.   It looks through each pool declaration in sequence (all
361 .I range
362 declarations that appear outside of pool declarations are grouped into
363 a single pool with no permit list).   If the permit list for the pool
364 allows the client to be allocated an address from that pool, the pool
365 is examined to see if there is an address available.   If so, then the
366 client is tentatively assigned that address.   Otherwise, the next
367 pool is tested.   If no addresses are found that can be assigned to
368 the client, no response is sent to the client.
369 .PP
370 If an address is found that the client is permitted to have, and that
371 has never been assigned to any client before, the address is
372 immediately allocated to the client.   If the address is available for
373 allocation but has been previously assigned to a different client, the
374 server will keep looking in hopes of finding an address that has never
375 before been assigned to a client.
376 .SH IP ADDRESS CONFLICT PREVENTION
377 The DHCP server checks IP addresses to see if they are in use before
378 allocating them to clients.   It does this by sending an ICMP Echo
379 request message to the IP address being allocated.   If no ICMP Echo
380 reply is received within a second, the address is assumed to be free.
381 This is only done for leases that have been specified in range
382 statements, and only when the lease is thought by the DHCP server to
383 be free - i.e., the DHCP server or its failover peer has not listed
384 the lease as in use.
385 .PP
386 If a response is received to an ICMP Echo request, the DHCP server
387 assumes that there is a configuration error - the IP address is in use
388 by some host on the network that is not a DHCP client.   It marks the
389 address as abandoned, and will not assign it to clients.
390 .PP
391 If a DHCP client tries to get an IP address, but none are available,
392 but there are abandoned IP addresses, then the DHCP server will
393 attempt to reclaim an abandoned IP address.   It marks one IP address
394 as free, and then does the same ICMP Echo request check described
395 previously.   If there is no answer to the ICMP Echo request, the
396 address is assigned to the client.
397 .PP
398 The DHCP server does not cycle through abandoned IP addresses if the
399 first IP address it tries to reclaim is free.   Rather, when the next
400 DHCPDISCOVER comes in from the client, it will attempt a new
401 allocation using the same method described here, and will typically
402 try a new IP address.
403 .SH DHCP FAILOVER
404 This version of the ISC DHCP server supports the DHCP failover
405 protocol as documented in draft-ietf-dhc-failover-07.txt.   This is
406 not a final protocol document, and we have not done interoperability
407 testing with other vendors' implementations of this protocol, so you
408 must not assume that this implementation conforms to the standard.
409 If you wish to use the failover protocol, make sure that both failover
410 peers are running the same version of the ISC DHCP server.
411 .PP
412 The failover protocol allows two DHCP servers (and no more than two)
413 to share a common address pool.   Each server will have about half of
414 the available IP addresses in the pool at any given time for
415 allocation.   If one server fails, the other server will continue to
416 renew leases out of the pool, and will allocate new addresses out of
417 the roughly half of available addresses that it had when
418 communications with the other server were lost.
419 .PP
420 It is possible during a prolonged failure to tell the remaining server
421 that the other server is down, in which case the remaining server will
422 (over time) reclaim all the addresses the other server had available
423 for allocation, and begin to reuse them.   This is called putting the
424 server into the PARTNER-DOWN state.
425 .PP
426 You can put the server into the PARTNER-DOWN state either by using the
427 .B omshell (1)
428 command or by stopping the server, editing the last peer state
429 declaration in the lease file, and restarting the server.   If you use
430 this last method, be sure to leave the date and time of the start of
431 the state blank:
432 .PP
433 .nf
434 .B failover peer "\fIname\fB" state {
435 .B   my   state partner-down;
436 .B   peer state \fIstate\fB at \fIdate\fB;
437 .B }
438 .fi
439 .PP
440 When the other server comes back online, it should automatically
441 detect that it has been offline and request a complete update from the
442 server that was running in the PARTNER-DOWN state, and then both
443 servers will resume processing together.
444 .PP
445 It is possible to get into a dangerous situation: if you put one
446 server into the PARTNER-DOWN state, and then *that* server goes down,
447 and the other server comes back up, the other server will not know
448 that the first server was in the PARTNER-DOWN state, and may issue
449 addresses previously issued by the other server to different clients,
450 resulting in IP address conflicts.   Before putting a server into
451 PARTNER-DOWN state, therefore, make
452 .I sure
453 that the other server will not restart automatically.
454 .PP
455 The failover protocol defines a primary server role and a secondary
456 server role.   There are some differences in how primaries and
457 secondaries act, but most of the differences simply have to do with
458 providing a way for each peer to behave in the opposite way from the
459 other.   So one server must be configured as primary, and the other
460 must be configured as secondary, and it doesn't matter too much which
461 one is which.
462 .SH FAILOVER STARTUP
463 When a server starts that has not previously communicated with its
464 failover peer, it must establish communications with its failover peer
465 and synchronize with it before it can serve clients.   This can happen
466 either because you have just configured your DHCP servers to perform
467 failover for the first time, or because one of your failover servers
468 has failed catastrophically and lost its database.
469 .PP
470 The initial recovery process is designed to ensure that when one
471 failover peer loses its database and then resynchronizes, any leases
472 that the failed server gave out before it failed will be honored.
473 When the failed server starts up, it notices that it has no saved
474 failover state, and attempts to contact its peer.
475 .PP
476 When it has established contact, it asks the peer for a complete copy
477 its peer's lease database.  The peer then sends its complete database,
478 and sends a message indicating that it is done.  The failed server
479 then waits until MCLT has passed, and once MCLT has passed both
480 servers make the transition back into normal operation.  This waiting
481 period ensures that any leases the failed server may have given out
482 while out of contact with its partner will have expired.
483 .PP
484 While the failed server is recovering, its partner remains in the
485 partner-down state, which means that it is serving all clients.  The
486 failed server provides no service at all to DHCP clients until it has
487 made the transition into normal operation.
488 .PP
489 In the case where both servers detect that they have never before
490 communicated with their partner, they both come up in this recovery
491 state and follow the procedure we have just described.   In this case,
492 no service will be provided to DHCP clients until MCLT has expired.
493 .SH CONFIGURING FAILOVER
494 In order to configure failover, you need to write a peer declaration
495 that configures the failover protocol, and you need to write peer
496 references in each pool declaration for which you want to do
497 failover.   You do not have to do failover for all pools on a given
498 network segment.    You must not tell one server it's doing failover
499 on a particular address pool and tell the other it is not.   You must
500 not have any common address pools on which you are not doing
501 failover.  A pool declaration that utilizes failover would look like this:
502 .PP
503 .nf
504 pool {
505         failover peer "foo";
506         \fIpool specific parameters\fR
507 };
508 .fi
509 .PP
510 .PP
511 The  server currently  does very  little  sanity checking,  so if  you
512 configure it wrong, it will just  fail in odd ways.  I would recommend
513 therefore that you either do  failover or don't do failover, but don't
514 do any mixed pools.  Also,  use the same master configuration file for
515 both  servers,  and  have  a  seperate file  that  contains  the  peer
516 declaration and includes the master file.  This will help you to avoid
517 configuration  mismatches.  As our  implementation evolves,  this will
518 become  less of  a  problem.  A  basic  sample dhcpd.conf  file for  a
519 primary server might look like this:
520 .PP
521 .nf
522 failover peer "foo" {
523   primary;
524   address anthrax.rc.vix.com;
525   port 519;
526   peer address trantor.rc.vix.com;
527   peer port 520;
528   max-response-delay 60;
529   max-unacked-updates 10;
530   mclt 3600;
531   split 128;
532   load balance max seconds 3;
533 }
534
535 include "/etc/dhcpd.master";
536 .fi
537 .PP
538 The statements in the peer declaration are as follows:
539 .PP
540 The 
541 .I primary
542 and
543 .I secondary
544 statements
545 .RS 0.25i
546 .PP
547 [ \fBprimary\fR | \fBsecondary\fR ]\fB;\fR
548 .PP
549 This determines whether the server is primary or secondary, as
550 described earlier under DHCP FAILOVER.
551 .RE
552 .PP
553 The 
554 .I address
555 statement
556 .RS 0.25i
557 .PP
558 .B address \fIaddress\fR\fB;\fR
559 .PP
560 The \fBaddress\fR statement declares the IP address or DNS name on which the
561 server should listen for connections from its failover peer, and also the
562 value to use for the DHCP Failover Protocol server identifier.  Because this
563 value is used as an identifier, it may not be omitted.
564 .RE
565 .PP
566 The 
567 .I peer address
568 statement
569 .RS 0.25i
570 .PP
571 .B peer address \fIaddress\fR\fB;\fR
572 .PP
573 The \fBpeer address\fR statement declares the IP address or DNS name to
574 which the server should connect to reach its failover peer for failover
575 messages.
576 .RE
577 .PP
578 The 
579 .I port
580 statement
581 .RS 0.25i
582 .PP
583 .B port \fIport-number\fR\fB;\fR
584 .PP
585 The \fBport\fR statement declares the TCP port on which the server
586 should listen for connections from its failover peer.   This statement
587 may not currently be omitted, because the failover protocol does not
588 yet have a reserved TCP port number.
589 .RE
590 .PP
591 The 
592 .I peer port
593 statement
594 .RS 0.25i
595 .PP
596 .B peer port \fIport-number\fR\fB;\fR
597 .PP
598 The \fBpeer port\fR statement declares the TCP port to which the
599 server should connect to reach its failover peer for failover
600 messages.   This statement may not be omitted because the failover
601 protocol does not yet have a reserved TCP port number.   The port
602 number declared in the \fBpeer port\fR statement may be the same as
603 the port number declared in the \fBport\fR statement.
604 .RE
605 .PP
606 The 
607 .I max-response-delay
608 statement
609 .RS 0.25i
610 .PP
611 .B max-response-delay \fIseconds\fR\fB;\fR
612 .PP
613 The \fBmax-response-delay\fR statement tells the DHCP server how
614 many seconds may pass without receiving a message from its failover
615 peer before it assumes that connection has failed.   This number
616 should be small enough that a transient network failure that breaks
617 the connection will not result in the servers being out of
618 communication for a long time, but large enough that the server isn't
619 constantly making and breaking connections.   This parameter must be
620 specified.
621 .RE
622 .PP
623 The 
624 .I max-unacked-updates
625 statement
626 .RS 0.25i
627 .PP
628 .B max-unacked-updates \fIcount\fR\fB;\fR
629 .PP
630 The \fBmax-unacked-updates\fR statement tells the DHCP server how
631 many BNDUPD messages it can send before it receives a BNDACK
632 from the failover peer.   We don't have enough operational experience
633 to say what a good value for this is, but 10 seems to work.   This
634 parameter must be specified.
635 .RE
636 .PP
637 The 
638 .I mclt
639 statement
640 .RS 0.25i
641 .PP
642 .B mclt \fIseconds\fR\fB;\fR
643 .PP
644 The \fBmclt\fR statement defines the Maximum Client Lead Time.   It
645 must be specified on the primary, and may not be specified on the
646 secondary.   This is the length of time for which a lease may be
647 renewed by either failover peer without contacting the other.   The
648 longer you set this, the longer it will take for the running server to
649 recover IP addresses after moving into PARTNER-DOWN state.   The
650 shorter you set it, the more load your servers will experience when
651 they are not communicating.   A value of something like 3600 is
652 probably reasonable, but again bear in mind that we have no real
653 operational experience with this.
654 .RE
655 .PP
656 The 
657 .I split
658 statement
659 .RS 0.25i
660 .PP
661 .B split \fIindex\fR\fB;\fR
662 .PP
663 The split statement specifies the split between the primary and
664 secondary for the purposes of load balancing.   Whenever a client
665 makes a DHCP request, the DHCP server runs a hash on the client
666 identification.   If the hash comes out to less than the split value,
667 the primary answers.   If it comes out to equal to or more than the
668 split, the secondary answers.   The only meaningful value is 128, and can
669 only be configured on the primary.
670 .RE
671 .PP
672 The 
673 .I hba
674 statement
675 .RS 0.25i
676 .PP
677 .B hba \fIcolon-seperated-hex-list\fB;\fR
678 .PP
679 The hba statement specifies the split between the primary and
680 secondary as a bitmap rather than a cutoff, which theoretically allows
681 for finer-grained control.   In practice, there is probably no need
682 for such fine-grained control, however.   An example hba statement:
683 .PP
684 .nf
685   hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
686       00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
687 .fi
688 .PP
689 This is equivalent to a \fBsplit 128;\fR statement.  You must only have
690 \fBsplit\fR or \fBhba\fR defined, never both.  For most cases, the
691 fine-grained control that \fBhba\fR offers isn't necessary, and \fBsplit\fR
692 should be used.  As such, the use of \fBhba\fR is deprecated.
693 .RE
694 .PP
695 The 
696 .I load balance max seconds
697 statement
698 .RS 0.25i
699 .PP
700 .B load balance max seconds \fIseconds\fR\fB;\fR
701 .PP
702 This statement allows you to configure a cutoff after which load
703 balancing is disabled.  The cutoff is based on the number of seconds
704 since the client sent its first DHCPDISCOVER or DHCPREQUEST message,
705 and only works with clients that correctly implement the \fIsecs\fR
706 field - fortunately most clients do.  We recommend setting this to
707 something like 3 or 5.  The effect of this is that if one of the
708 failover peers gets into a state where it is responding to failover
709 messages but not responding to some client requests, the other
710 failover peer will take over its client load automatically as the
711 clients retry.
712 .RE
713 .SH CLIENT CLASSING
714 Clients can be seperated into classes, and treated differently
715 depending on what class they are in.   This seperation can be done
716 either with a conditional statement, or with a match statement within
717 the class declaration.   It is possible to specify a limit on the
718 total number of clients within a particular class or subclass that may
719 hold leases at one time, and it is possible to specify automatic
720 subclassing based on the contents of the client packet.
721 .PP
722 To add clients to classes based on conditional evaluation, you can
723 specify a matching expression in the class statement:
724 .PP
725 .nf
726 class "ras-clients" {
727   match if substring (option dhcp-client-identifier, 1, 3) = "RAS";
728 }
729 .fi
730 Note that whether you use matching expressions or add statements (or
731 both) to classify clients, you must always write a class declaration
732 for any class that you use.   If there will be no match statement and
733 no in-scope statements for a class, the declaration should look like
734 this:
735 .nf
736 class "ras-clients" {
737 }
738 .fi
739 .SH SUBCLASSES
740 .PP
741 In addition to classes, it is possible to declare subclasses.   A
742 subclass is a class with the same name as a regular class, but with a
743 specific submatch expression which is hashed for quick matching.
744 This is essentially a speed hack - the main difference between five
745 classes with match expressions and one class with five subclasses is
746 that it will be quicker to find the subclasses.   Subclasses work as
747 follows:
748 .PP
749 .nf
750 class "allocation-class-1" {
751   match pick-first-value (option dhcp-client-identifier, hardware);
752 }
753
754 class "allocation-class-2" {
755   match pick-first-value (option dhcp-client-identifier, hardware);
756 }
757
758 subclass "allocation-class-1" 1:8:0:2b:4c:39:ad;
759 subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3;
760 subclass "allocation-class-1" 1:0:0:c4:aa:29:44;
761
762 subnet 10.0.0.0 netmask 255.255.255.0 {
763   pool {
764     allow members of "allocation-class-1";
765     range 10.0.0.11 10.0.0.50;
766   }
767   pool {
768     allow members of "allocation-class-2";
769     range 10.0.0.51 10.0.0.100;
770   }
771 }
772 .fi
773 .PP
774 The data following the class name in the subclass declaration is a
775 constant value to use in matching the match expression for the class.
776 When class matching is done, the server will evaluate the match
777 expression and then look the result up in the hash table.   If it
778 finds a match, the client is considered a member of both the class and
779 the subclass.
780 .PP
781 Subclasses can be declared with or without scope.   In the above
782 example, the sole purpose of the subclass is to allow some clients
783 access to one address pool, while other clients are given access to
784 the other pool, so these subclasses are declared without scopes.   If
785 part of the purpose of the subclass were to define different parameter
786 values for some clients, you might want to declare some subclasses
787 with scopes.
788 .PP
789 In the above example, if you had a single client that needed some
790 configuration parameters, while most didn't, you might write the
791 following subclass declaration for that client:
792 .PP
793 .nf
794 subclass "allocation-class-2" 1:08:00:2b:a1:11:31 {
795   option root-path "samsara:/var/diskless/alphapc";
796   filename "/tftpboot/netbsd.alphapc-diskless";
797 }
798 .fi
799 .PP
800 In this example, we've used subclassing as a way to control address
801 allocation on a per-client basis.  However, it's also possible to use
802 subclassing in ways that are not specific to clients - for example, to
803 use the value of the vendor-class-identifier option to determine what
804 values to send in the vendor-encapsulated-options option.  An example
805 of this is shown under the VENDOR ENCAPSULATED OPTIONS head in the
806 .B dhcp-options(5)
807 manual page.
808 .SH PER-CLASS LIMITS ON DYNAMIC ADDRESS ALLOCATION
809 .PP
810 You may specify a limit to the number of clients in a class that can
811 be assigned leases.   The effect of this will be to make it difficult
812 for a new client in a class to get an address.   Once a class with
813 such a limit has reached its limit, the only way a new client in that
814 class can get a lease is for an existing client to relinquish its
815 lease, either by letting it expire, or by sending a DHCPRELEASE
816 packet.   Classes with lease limits are specified as follows:
817 .PP
818 .nf
819 class "limited-1" {
820   lease limit 4;
821 }
822 .fi
823 .PP
824 This will produce a class in which a maximum of four members may hold
825 a lease at one time.
826 .SH SPAWNING CLASSES
827 .PP
828 It is possible to declare a
829 .I spawning class\fR.
830 A spawning class is a class that automatically produces subclasses
831 based on what the client sends.   The reason that spawning classes
832 were created was to make it possible to create lease-limited classes
833 on the fly.   The envisioned application is a cable-modem environment
834 where the ISP wishes to provide clients at a particular site with more
835 than one IP address, but does not wish to provide such clients with
836 their own subnet, nor give them an unlimited number of IP addresses
837 from the network segment to which they are connected.
838 .PP
839 Many cable modem head-end systems can be configured to add a Relay
840 Agent Information option to DHCP packets when relaying them to the
841 DHCP server.   These systems typically add a circuit ID or remote ID
842 option that uniquely identifies the customer site.   To take advantage
843 of this, you can write a class declaration as follows:
844 .PP
845 .nf
846 class "customer" {
847   spawn with option agent.circuit-id;
848   lease limit 4;
849 }
850 .fi
851 .PP
852 Now whenever a request comes in from a customer site, the circuit ID
853 option will be checked against the class's hash table.   If a subclass
854 is found that matches the circuit ID, the client will be classified in
855 that subclass and treated accordingly.   If no subclass is found
856 matching the circuit ID, a new one will be created and logged in the
857 .B dhcpd.leases
858 file, and the client will be classified in this new class.   Once the
859 client has been classified, it will be treated according to the rules
860 of the class, including, in this case, being subject to the per-site
861 limit of four leases.
862 .PP
863 The use of the subclass spawning mechanism is not restricted to relay
864 agent options - this particular example is given only because it is a
865 fairly straightforward one.
866 .SH COMBINING MATCH, MATCH IF AND SPAWN WITH
867 .PP
868 In some cases, it may be useful to use one expression to assign a
869 client to a particular class, and a second expression to put it into a
870 subclass of that class.   This can be done by combining the \fBmatch
871 if\fR and \fBspawn with\fR statements, or the \fBmatch if\fR and
872 \fBmatch\fR statements.   For example:
873 .PP
874 .nf
875 class "jr-cable-modems" {
876   match if option dhcp-vendor-identifier = "jrcm";
877   spawn with option agent.circuit-id;
878   lease limit 4;
879 }
880
881 class "dv-dsl-modems" {
882   match if opton dhcp-vendor-identifier = "dvdsl";
883   spawn with option agent.circuit-id;
884   lease limit 16;
885 }
886 .fi
887 .PP
888 This allows you to have two classes that both have the same \fBspawn
889 with\fR expression without getting the clients in the two classes
890 confused with each other.
891 .SH DYNAMIC DNS UPDATES
892 .PP
893 The DHCP server has the ability to dynamically update the Domain Name
894 System.  Within the configuration files, you can define how you want
895 the Domain Name System to be updated.  These updates are RFC 2136
896 compliant so any DNS server supporting RFC 2136 should be able to
897 accept updates from the DHCP server.
898 .PP
899 Two DNS update schemes are currently implemented, and another is
900 planned.   The two that are currently available are the ad-hoc DNS
901 update mode and the interim DHCP-DNS interaction draft update mode.
902 If and when the DHCP-DNS interaction draft and the DHCID draft make it
903 through the IETF standards process, there will be a third mode, which
904 will be the standard DNS update method.   The DHCP server must be
905 configured to use one of the two currently-supported methods, or not
906 to do dns updates.   This can be done with the
907 .I ddns-update-style
908 configuration parameter.
909 .SH THE AD-HOC DNS UPDATE SCHEME
910 The ad-hoc Dynamic DNS update scheme is
911 .B now deprecated
912 and
913 .B
914 does not work.
915 In future releases of the ISC DHCP server, this scheme will not likely be
916 available.  The interim scheme works, allows for failover, and should now be
917 used.  The following description is left here for informational purposes
918 only.
919 .PP
920 The ad-hoc Dynamic DNS update scheme implemented in this version of
921 the ISC DHCP server is a prototype design, which does not
922 have much to do with the standard update method that is being
923 standardized in the IETF DHC working group, but rather implements some
924 very basic, yet useful, update capabilities.   This mode
925 .B does not work
926 with the
927 .I failover protocol
928 because it does not account for the possibility of two different DHCP
929 servers updating the same set of DNS records.
930 .PP
931 For the ad-hoc DNS update method, the client's FQDN is derived in two
932 parts.   First, the hostname is determined.   Then, the domain name is
933 determined, and appended to the hostname.
934 .PP
935 The DHCP server determines the client's hostname by first looking for
936 a \fIddns-hostname\fR configuration option, and using that if it is
937 present.  If no such option is present, the server looks for a
938 valid hostname in the FQDN option sent by the client.  If one is
939 found, it is used; otherwise, if the client sent a host-name option,
940 that is used.  Otherwise, if there is a host declaration that applies
941 to the client, the name from that declaration will be used.  If none
942 of these applies, the server will not have a hostname for the client,
943 and will not be able to do a DNS update.
944 .PP
945 The domain name is determined based strictly on the server
946 configuration, not on what the client sends.   First, if there is a 
947 .I ddns-domainname
948 configuration option, it is used.   Second, if there is a
949 \fIdomain-name\fR option configured, that is used.  Otherwise, the
950 server will not do the DNS update.
951 .PP
952 The client's fully-qualified domain name, derived as we have
953 described, is used as the name on which an "A" record will be stored.
954 The A record will contain the IP address that the client was assigned
955 in its lease.   If there is already an A record with the same name in
956 the DNS server, no update of either the A or PTR records will occur -
957 this prevents a client from claiming that its hostname is the name of
958 some network server.   For example, if you have a fileserver called
959 "fs.sneedville.edu", and the client claims its hostname is "fs", no
960 DNS update will be done for that client, and an error message will be
961 logged.
962 .PP
963 If the A record update succeeds, a PTR record update for the assigned
964 IP address will be done, pointing to the A record.   This update is
965 unconditional - it will be done even if another PTR record of the same
966 name exists.   Since the IP address has been assigned to the DHCP
967 server, this should be safe.
968 .PP
969 Please note that the current implementation assumes clients only have
970 a single network interface.   A client with two network interfaces
971 will see unpredictable behavior.   This is considered a bug, and will
972 be fixed in a later release.   It may be helpful to enable the
973 .I one-lease-per-client
974 parameter so that roaming clients do not trigger this same behavior.
975 .PP
976 The DHCP protocol normally involves a four-packet exchange - first the
977 client sends a DHCPDISCOVER message, then the server sends a
978 DHCPOFFER, then the client sends a DHCPREQUEST, then the server sends
979 a DHCPACK.   In the current version of the server, the server will do
980 a DNS update after it has received the DHCPREQUEST, and before it has
981 sent the DHCPACK.   It only sends the DNS update if it has not sent
982 one for the client's address before, in order to minimize the impact
983 on the DHCP server.
984 .PP
985 When the client's lease expires, the DHCP server (if it is operating
986 at the time, or when next it operates) will remove the client's A and
987 PTR records from the DNS database.   If the client releases its lease
988 by sending a DHCPRELEASE message, the server will likewise remove the
989 A and PTR records.
990 .SH THE INTERIM DNS UPDATE SCHEME
991 The interim DNS update scheme operates mostly according to several
992 drafts that are being considered by the IETF and are expected to
993 become standards, but are not yet standards, and may not be
994 standardized exactly as currently proposed.   These are:
995 .PP
996 .nf
997 .ce 3
998 draft-ietf-dhc-ddns-resolution-??.txt
999 draft-ietf-dhc-fqdn-option-??.txt
1000 draft-ietf-dnsext-dhcid-rr-??.txt
1001 .fi
1002 .PP
1003 Because our implementation is slightly different than the standard, we
1004 will briefly document the operation of this update style here.
1005 .PP
1006 The first point to understand about this style of DNS update is that
1007 unlike the ad-hoc style, the DHCP server does not necessarily
1008 always update both the A and the PTR records.   The FQDN option
1009 includes a flag which, when sent by the client, indicates that the
1010 client wishes to update its own A record.   In that case, the server
1011 can be configured either to honor the client's intentions or ignore
1012 them.   This is done with the statement \fIallow client-updates;\fR or
1013 the statement \fIignore client-updates;\fR.   By default, client
1014 updates are allowed.
1015 .PP
1016 If the server is configured to allow client updates, then if the
1017 client sends a fully-qualified domain name in the FQDN option, the
1018 server will use that name the client sent in the FQDN option to update
1019 the PTR record.   For example, let us say that the client is a visitor
1020 from the "radish.org" domain, whose hostname is "jschmoe".   The
1021 server is for the "example.org" domain.   The DHCP client indicates in
1022 the FQDN option that its FQDN is "jschmoe.radish.org.".   It also
1023 indicates that it wants to update its own A record.   The DHCP server
1024 therefore does not attempt to set up an A record for the client, but
1025 does set up a PTR record for the IP address that it assigns the
1026 client, pointing at jschmoe.radish.org.   Once the DHCP client has an
1027 IP address, it can update its own A record, assuming that the
1028 "radish.org" DNS server will allow it to do so.
1029 .PP
1030 If the server is configured not to allow client updates, or if the
1031 client doesn't want to do its own update, the server will simply
1032 choose a name for the client, possibly using the hostname supplied by
1033 the client ("jschmoe" in the previous example).   It will use its own
1034 domain name for the client, just as in the ad-hoc update scheme.
1035 It will then update both the A and PTR record, using the name that it
1036 chose for the client.   If the client sends a fully-qualified domain
1037 name in the fqdn option, the server uses only the leftmost part of the
1038 domain name - in the example above, "jschmoe" instead of
1039 "jschmoe.radish.org".
1040 .PP
1041 The other difference between the ad-hoc scheme and the interim
1042 scheme is that with the interim scheme, a method is used that
1043 allows more than one DHCP server to update the DNS database without
1044 accidentally deleting A records that shouldn't be deleted nor failing
1045 to add A records that should be added.   The scheme works as follows:
1046 .PP
1047 When the DHCP server issues a client a new lease, it creates a text
1048 string that is an MD5 hash over the DHCP client's identification (see
1049 draft-ietf-dnsext-dhcid-rr-??.txt for details).   The update adds an A
1050 record with the name the server chose and a TXT record containing the
1051 hashed identifier string (hashid).   If this update succeeds, the
1052 server is done.
1053 .PP
1054 If the update fails because the A record already exists, then the DHCP
1055 server attempts to add the A record with the prerequisite that there
1056 must be a TXT record in the same name as the new A record, and that
1057 TXT record's contents must be equal to hashid.   If this update
1058 succeeds, then the client has its A record and PTR record.   If it
1059 fails, then the name the client has been assigned (or requested) is in
1060 use, and can't be used by the client.   At this point the DHCP server
1061 gives up trying to do a DNS update for the client until the client
1062 chooses a new name.
1063 .PP
1064 The interim DNS update scheme is called interim for two reasons.
1065 First, it does not quite follow the drafts.   The current versions of
1066 the drafts call for a new DHCID RRtype, but this is not yet
1067 available.   The interim DNS update scheme uses a TXT record
1068 instead.   Also, the existing ddns-resolution draft calls for the DHCP
1069 server to put a DHCID RR on the PTR record, but the \fIinterim\fR
1070 update method does not do this.   It is our position that this is not
1071 useful, and we are working with the author in hopes of removing it
1072 from the next version of the draft, or better understanding why it is
1073 considered useful.
1074 .PP
1075 In addition to these differences, the server also does not update very
1076 aggressively.  Because each DNS update involves a round trip to the
1077 DNS server, there is a cost associated with doing updates even if they
1078 do not actually modify the DNS database.   So the DHCP server tracks
1079 whether or not it has updated the record in the past (this information
1080 is stored on the lease) and does not attempt to update records that it
1081 thinks it has already updated.
1082 .PP
1083 This can lead to cases where the DHCP server adds a record, and then
1084 the record is deleted through some other mechanism, but the server
1085 never again updates the DNS because it thinks the data is already
1086 there.   In this case the data can be removed from the lease through
1087 operator intervention, and once this has been done, the DNS will be
1088 updated the next time the client renews.
1089 .SH DYNAMIC DNS UPDATE SECURITY
1090 .PP
1091 When you set your DNS server up to allow updates from the DHCP server,
1092 you may be exposing it to unauthorized updates.  To avoid this, you
1093 should use TSIG signatures - a method of cryptographically signing
1094 updates using a shared secret key.   As long as you protect the
1095 secrecy of this key, your updates should also be secure.   Note,
1096 however, that the DHCP protocol itself provides no security, and that
1097 clients can therefore provide information to the DHCP server which the
1098 DHCP server will then use in its updates, with the constraints
1099 described previously.
1100 .PP
1101 The DNS server must be configured to allow updates for any zone that
1102 the DHCP server will be updating.  For example, let us say that
1103 clients in the sneedville.edu domain will be assigned addresses on the
1104 10.10.17.0/24 subnet.  In that case, you will need a key declaration
1105 for the TSIG key you will be using, and also two zone declarations -
1106 one for the zone containing A records that will be updates and one for
1107 the zone containing PTR records - for ISC BIND, something like this:
1108 .PP
1109 .nf
1110 key DHCP_UPDATER {
1111   algorithm HMAC-MD5.SIG-ALG.REG.INT;
1112   secret pRP5FapFoJ95JEL06sv4PQ==;
1113 };
1114
1115 zone "example.org" {
1116         type master;
1117         file "example.org.db";
1118         allow-update { key DHCP_UPDATER; };
1119 };
1120
1121 zone "17.10.10.in-addr.arpa" {
1122         type master;
1123         file "10.10.17.db";
1124         allow-update { key DHCP_UPDATER; };
1125 };
1126 .fi
1127 .PP
1128 You will also have to configure your DHCP server to do updates to
1129 these zones.   To do so, you need to add something like this to your
1130 dhcpd.conf file:
1131 .PP
1132 .nf
1133 key DHCP_UPDATER {
1134   algorithm HMAC-MD5.SIG-ALG.REG.INT;
1135   secret pRP5FapFoJ95JEL06sv4PQ==;
1136 };
1137
1138 zone EXAMPLE.ORG. {
1139   primary 127.0.0.1;
1140   key DHCP_UPDATER;
1141 }
1142
1143 zone 17.127.10.in-addr.arpa. {
1144   primary 127.0.0.1;
1145   key DHCP_UPDATER;
1146 }
1147 .fi
1148 .PP
1149 Note that the zone declarations have to correspond to authority
1150 records in your name server - in the above example, there must be an
1151 SOA record for "example.org." and for "17.10.10.in-addr.arpa.".   For
1152 example, if there were a subdoman "foo.example.org" with no seperate
1153 SOA, you could not write a zone declaration for "foo.example.org."  
1154 Also keep in mind that zone names in your DHCP configuration should end in a
1155 "."; this is the preferred syntax.  If you do not end your zone name in a
1156 ".", the DHCP server will figure it out.  Also note that in the DHCP
1157 configuration, zone names are not encapsulated in quotes where there are in
1158 the DNS configuration.
1159 .PP
1160 You should choose your own secret key, of course.  The ISC BIND 8 and
1161 9 distributions come with a program for generating secret keys called
1162 dnssec-keygen.  The version that comes with BIND 9 is likely to produce a
1163 substantially more random key, so we recommend you use that one even
1164 if you are not using BIND 9 as your DNS server.  If you are using BIND 9's
1165 dnssec-keygen, the above key would be created as follows:
1166 .nf
1167         dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER
1168 .fi
1169 .PP
1170 If you are using the BIND 8 dnskeygen program, the following command will
1171 generate a key as seen above:
1172 .nf
1173         dnskeygen -H 128 -u -c -n DHCP_UPDATER
1174 .fi
1175 .PP
1176 You may wish to enable logging of DNS updates on your DNS server.
1177 To do so, you might write a logging statement like the following:
1178 .PP
1179 .nf
1180 logging {
1181         channel update_debug {
1182                 file "/var/log/update-debug.log";
1183                 severity        debug 3;
1184                 print-category  yes;
1185                 print-severity  yes;
1186                 print-time      yes;
1187         };
1188         channel security_info   {
1189                 file    "/var/log/named-auth.info";
1190                 severity        info;
1191                 print-category  yes;
1192                 print-severity  yes;
1193                 print-time      yes;
1194         };
1195
1196         category update { update_debug; };
1197         category security { security_info; };
1198 };
1199 .fi
1200 .PP
1201 You must create the /var/log/named-auth.info and
1202 /var/log/update-debug.log files before starting the name server.   For
1203 more information on configuring ISC BIND, consult the documentation
1204 that accompanies it.
1205 .SH REFERENCE: EVENTS
1206 .PP
1207 There are three kinds of events that can happen regarding a lease, and
1208 it is possible to declare statements that occur when any of these
1209 events happen.   These events are the commit event, when the server
1210 has made a commitment of a certain lease to a client, the release
1211 event, when the client has released the server from its commitment,
1212 and the expiry event, when the commitment expires.
1213 .PP
1214 To declare a set of statements to execute when an event happens, you
1215 must use the \fBon\fR statement, followed by the name of the event,
1216 followed by a series of statements to execute when the event happens,
1217 enclosed in braces.   Events are used to implement DNS
1218 updates, so you should not define your own event handlers if you are
1219 using the built-in DNS update mechanism.
1220 .PP
1221 The built-in version of the DNS update mechanism is in a text
1222 string towards the top of server/dhcpd.c.   If you want to use events
1223 for things other than DNS updates, and you also want DNS updates, you
1224 will have to start out by copying this code into your dhcpd.conf file
1225 and modifying it.
1226 .SH REFERENCE: DECLARATIONS
1227 .PP
1228 .B The 
1229 .I shared-network
1230 .B statement
1231 .PP
1232 .nf
1233  \fBshared-network\fR \fIname\fR \fB{\fR
1234    [ \fIparameters\fR ]
1235    [ \fIdeclarations\fR ]
1236  \fB}\fR
1237 .fi
1238 .PP
1239 The \fIshared-network\fR statement is used to inform the DHCP server
1240 that some IP subnets actually share the same physical network.  Any
1241 subnets in a shared network should be declared within a
1242 \fIshared-network\fR statement.  Parameters specified in the
1243 \fIshared-network\fR statement will be used when booting clients on
1244 those subnets unless parameters provided at the subnet or host level
1245 override them.  If any subnet in a shared network has addresses
1246 available for dynamic allocation, those addresses are collected into a
1247 common pool for that shared network and assigned to clients as needed.
1248 There is no way to distinguish on which subnet of a shared network a
1249 client should boot.
1250 .PP
1251 .I Name
1252 should be the name of the shared network.   This name is used when
1253 printing debugging messages, so it should be descriptive for the
1254 shared network.   The name may have the syntax of a valid domain name
1255 (although it will never be used as such), or it may be any arbitrary
1256 name, enclosed in quotes.
1257 .PP
1258 .B The 
1259 .I subnet
1260 .B statement
1261 .PP
1262 .nf
1263  \fBsubnet\fR \fIsubnet-number\fR \fBnetmask\fR \fInetmask\fR \fB{\fR
1264    [ \fIparameters\fR ]
1265    [ \fIdeclarations\fR ]
1266  \fB}\fR
1267 .fi
1268 .PP
1269 The \fIsubnet\fR statement is used to provide dhcpd with enough
1270 information to tell whether or not an IP address is on that subnet.
1271 It may also be used to provide subnet-specific parameters and to
1272 specify what addresses may be dynamically allocated to clients booting
1273 on that subnet.   Such addresses are specified using the \fIrange\fR
1274 declaration.
1275 .PP
1276 The
1277 .I subnet-number
1278 should be an IP address or domain name which resolves to the subnet
1279 number of the subnet being described.   The 
1280 .I netmask
1281 should be an IP address or domain name which resolves to the subnet mask
1282 of the subnet being described.   The subnet number, together with the
1283 netmask, are sufficient to determine whether any given IP address is
1284 on the specified subnet.
1285 .PP
1286 Although a netmask must be given with every subnet declaration, it is
1287 recommended that if there is any variance in subnet masks at a site, a
1288 subnet-mask option statement be used in each subnet declaration to set
1289 the desired subnet mask, since any subnet-mask option statement will
1290 override the subnet mask declared in the subnet statement.
1291 .PP
1292 .B The
1293 .I range
1294 .B statement
1295 .PP
1296 .nf
1297 .B range\fR [ \fBdynamic-bootp\fR ] \fIlow-address\fR [ \fIhigh-address\fR]\fB;\fR
1298 .fi
1299 .PP
1300 For any subnet on which addresses will be assigned dynamically, there
1301 must be at least one \fIrange\fR statement.   The range statement
1302 gives the lowest and highest IP addresses in a range.   All IP
1303 addresses in the range should be in the subnet in which the
1304 \fIrange\fR statement is declared.   The \fIdynamic-bootp\fR flag may
1305 be specified if addresses in the specified range may be dynamically
1306 assigned to BOOTP clients as well as DHCP clients.   When specifying a
1307 single address, \fIhigh-address\fR can be omitted.
1308 .PP
1309 .B The
1310 .I host
1311 .B statement
1312 .PP
1313 .nf
1314  \fBhost\fR \fIhostname\fR {
1315    [ \fIparameters\fR ]
1316    [ \fIdeclarations\fR ]
1317  \fB}\fR
1318 .fi
1319 .PP
1320 There must be at least one
1321 .B host
1322 statement for every BOOTP client that is to be served.   
1323 .B host
1324 statements may also be specified for DHCP clients, although this is
1325 not required unless booting is only enabled for known hosts.
1326 .PP
1327 If it is desirable to be able to boot a DHCP or BOOTP
1328 client on more than one subnet with fixed addresses, more than one
1329 address may be specified in the
1330 .I fixed-address
1331 parameter, or more than one
1332 .B host
1333 statement may be specified.
1334 .PP
1335 If client-specific boot parameters must change based on the network
1336 to which the client is attached, then multiple 
1337 .B host
1338 statements should
1339 be used.
1340 .PP
1341 If a client is to be booted using a fixed address if it's
1342 possible, but should be allocated a dynamic address otherwise, then a
1343 .B host
1344 statement must be specified without a
1345 .B fixed-address
1346 clause.
1347 .I hostname
1348 should be a name identifying the host.  If a \fIhostname\fR option is
1349 not specified for the host, \fIhostname\fR is used.
1350 .PP
1351 \fIHost\fR declarations are matched to actual DHCP or BOOTP clients
1352 by matching the \fRdhcp-client-identifier\fR option specified in the
1353 \fIhost\fR declaration to the one supplied by the client, or, if the
1354 \fIhost\fR declaration or the client does not provide a
1355 \fRdhcp-client-identifier\fR option, by matching the \fIhardware\fR
1356 parameter in the \fIhost\fR declaration to the network hardware
1357 address supplied by the client.   BOOTP clients do not normally
1358 provide a \fIdhcp-client-identifier\fR, so the hardware address must
1359 be used for all clients that may boot using the BOOTP protocol.
1360 .PP
1361 .B The
1362 .I group
1363 .B statement
1364 .PP
1365 .nf
1366  \fBgroup\fR {
1367    [ \fIparameters\fR ]
1368    [ \fIdeclarations\fR ]
1369  \fB}\fR
1370 .fi
1371 .PP
1372 The group statement is used simply to apply one or more parameters to
1373 a group of declarations.   It can be used to group hosts, shared
1374 networks, subnets, or even other groups.
1375 .SH REFERENCE: ALLOW AND DENY
1376 The
1377 .I allow
1378 and
1379 .I deny
1380 statements can be used to control the response of the DHCP server to
1381 various sorts of requests.  The allow and deny keywords actually have
1382 different meanings depending on the context.  In a pool context, these
1383 keywords can be used to set up access lists for address allocation
1384 pools.  In other contexts, the keywords simply control general server
1385 behavior with respect to clients based on scope.   In a non-pool
1386 context, the
1387 .I ignore
1388 keyword can be used in place of the
1389 .I deny
1390 keyword to prevent logging of denied requests.
1391 .PP
1392 .SH ALLOW DENY AND IGNORE IN SCOPE
1393 The following usages of allow and deny will work in any scope,
1394 although it is not recommended that they be used in pool
1395 declarations.
1396 .PP
1397 .B The
1398 .I unknown-clients
1399 .B keyword
1400 .PP
1401  \fBallow unknown-clients;\fR
1402  \fBdeny unknown-clients;\fR
1403  \fBignore unknown-clients;\fR
1404 .PP
1405 The \fBunknown-clients\fR flag is used to tell dhcpd whether
1406 or not to dynamically assign addresses to unknown clients.   Dynamic
1407 address assignment to unknown clients is \fBallow\fRed by default.
1408 An unknown client is simply a client that has no host declaration.
1409 .PP
1410 The use of this option is now \fIdeprecated\fR.  If you are trying to
1411 restrict access on your network to known clients, you should use \fBdeny
1412 unknown clients;\fR inside of your address pool, as described under the
1413 heading ALLOW AND DENY WITHIN POOL DECLARAIONS.
1414 .PP
1415 .B The
1416 .I bootp
1417 .B keyword
1418 .PP
1419  \fBallow bootp;\fR
1420  \fBdeny bootp;\fR
1421  \fBignore bootp;\fR
1422 .PP
1423 The \fBbootp\fR flag is used to tell dhcpd whether
1424 or not to respond to bootp queries.  Bootp queries are \fBallow\fRed
1425 by default.
1426 .PP
1427 .B The
1428 .I booting
1429 .B keyword
1430 .PP
1431  \fBallow booting;\fR
1432  \fBdeny booting;\fR
1433  \fBignore booting;\fR
1434 .PP
1435 The \fBbooting\fR flag is used to tell dhcpd whether or not to respond
1436 to queries from a particular client.  This keyword only has meaning
1437 when it appears in a host declaration.   By default, booting is
1438 \fBallow\fRed, but if it is disabled for a particular client, then
1439 that client will not be able to get and address from the DHCP server.
1440 .B The
1441 .I duplicates
1442 .B keyword
1443 .PP
1444  \fBallow duplicates;\fR
1445  \fBdeny duplicates;\fR
1446 .PP
1447 Host declarations can match client messages based on the DHCP Client
1448 Identifer option or based on the client's network hardware type and
1449 MAC address.   If the MAC address is used, the host declaration will
1450 match any client with that MAC address - even clients with different
1451 client identifiers.   This doesn't normally happen, but is possible
1452 when one computer has more than one operating system installed on it -
1453 for example, Microsoft Windows and NetBSD or Linux.
1454 .PP
1455 The \fBduplicates\fR flag tells the DHCP server that if a request is
1456 received from a client that matches the MAC address of a host
1457 declaration, any other leases matching that MAC address should be
1458 discarded by the server, even if the UID is not the same.   This is a
1459 violation of the DHCP protocol, but can prevent clients whose client
1460 identifiers change regularly from holding many leases at the same time.
1461 By default, duplicates are \fBallow\fRed.
1462 .B The
1463 .I declines
1464 .B keyword
1465 .PP
1466  \fBallow declines;\fR
1467  \fBdeny declines;\fR
1468  \fBignore declines;\fR
1469 .PP
1470 The DHCPDECLINE message is used by DHCP clients to indicate that the
1471 lease the server has offered is not valid.   When the server receives
1472 a DHCPDECLINE for a particular address, it normally abandons that
1473 address, assuming that some unauthorized system is using it.
1474 Unfortunately, a malicious or buggy client can, using DHCPDECLINE
1475 messages, completely exhaust the DHCP server's allocation pool.   The
1476 server will reclaim these leases, but while the client is running
1477 through the pool, it may cause serious thrashing in the DNS, and it
1478 will also cause the DHCP server to forget old DHCP client address
1479 allocations.
1480 .PP
1481 The \fBdeclines\fR flag tells the DHCP server whether or not to honor
1482 DHCPDECLINE messages.   If it is set to \fBdeny\fR or \fBignore\fR in
1483 a particular scope, the DHCP server will not respond to DHCPDECLINE
1484 messages.
1485 .B The
1486 .I client-updates
1487 .B keyword
1488 .PP
1489  \fBallow client-updates;\fR
1490  \fBdeny client-updates;\fR
1491 .PP
1492 The \fBclient-updates\fR flag tells the DHCP server whether or not to
1493 honor the client's intention to do its own update of its A record.
1494 This is only relevant when doing \fIinterim\fR DNS updates.   See the
1495 documentation under the heading THE INTERIM DNS UPDATE SCHEME for
1496 details.
1497 .SH ALLOW AND DENY WITHIN POOL DECLARATIONS
1498 .PP
1499 The uses of the allow and deny keywords shown in the previous section
1500 work pretty much the same way whether the client is sending a
1501 DHCPDISCOVER or a DHCPREQUEST message - an address will be allocated
1502 to the client (either the old address it's requesting, or a new
1503 address) and then that address will be tested to see if it's okay to
1504 let the client have it.   If the client requested it, and it's not
1505 okay, the server will send a DHCPNAK message.   Otherwise, the server
1506 will simply not respond to the client.   If it is okay to give the
1507 address to the client, the server will send a DHCPACK message.
1508 .PP
1509 The primary motivation behind pool declarations is to have address
1510 allocation pools whose allocation policies are different.   A client
1511 may be denied access to one pool, but allowed access to another pool
1512 on the same network segment.   In order for this to work, access
1513 control has to be done during address allocation, not after address
1514 allocation is done.
1515 .PP
1516 When a DHCPREQUEST message is processed, address allocation simply
1517 consists of looking up the address the client is requesting and seeing
1518 if it's still available for the client.  If it is, then the DHCP
1519 server checks both the address pool permit lists and the relevant
1520 in-scope allow and deny statements to see if it's okay to give the
1521 lease to the client.  In the case of a DHCPDISCOVER message, the
1522 allocation process is done as described previously in the ADDRESS
1523 ALLOCATION section.
1524 .PP
1525 When declaring permit lists for address allocation pools, the
1526 following syntaxes are recognized following the allow or deny keywords:
1527 .PP
1528  \fBknown clients;\fR
1529 .PP
1530 If specified, this statement either allows or prevents allocation from
1531 this pool to any client that has a host declaration (i.e., is known).
1532 A client is known if it has a host declaration in \fIany\fR scope, not
1533 just the current scope.
1534 .PP
1535  \fBunknown clients;\fR
1536 .PP
1537 If specified, this statement either allows or prevents allocation from
1538 this pool to any client that has no host declaration (i.e., is not
1539 known).
1540 .PP
1541  \fBmembers of "\fRclass\fB";\fR
1542 .PP
1543 If specified, this statement either allows or prevents allocation from
1544 this pool to any client that is a member of the named class.
1545 .PP
1546  \fBdynamic bootp clients;\fR
1547 .PP
1548 If specified, this statement either allows or prevents allocation from
1549 this pool to any bootp client.
1550 .PP
1551  \fBauthenticated clients;\fR
1552 .PP
1553 If specified, this statement either allows or prevents allocation from
1554 this pool to any client that has been authenticated using the DHCP
1555 authentication protocol.   This is not yet supported.
1556 .PP
1557  \fBunauthenticated clients;\fR
1558 .PP
1559 If specified, this statement either allows or prevents allocation from
1560 this pool to any client that has not been authenticated using the DHCP
1561 authentication protocol.   This is not yet supported.
1562 .PP
1563  \fBall clients;\fR
1564 .PP
1565 If specified, this statement either allows or prevents allocation from
1566 this pool to all clients.   This can be used when you want to write a
1567 pool declaration for some reason, but hold it in reserve, or when you
1568 want to renumber your network quickly, and thus want the server to
1569 force all clients that have been allocated addresses from this pool to
1570 obtain new addresses immediately when they next renew.
1571 .SH REFERENCE: PARAMETERS
1572 The
1573 .I always-broadcast
1574 statement
1575 .RS 0.25i
1576 .PP
1577 .B always-broadcast \fIflag\fR\fB;\fR
1578 .PP
1579 The DHCP and BOOTP protocols both require DHCP and BOOTP clients to
1580 set the broadcast bit in the flags field of the BOOTP message header.
1581 Unfortunately, some DHCP and BOOTP clients do not do this, and
1582 therefore may not receive responses from the DHCP server.   The DHCP
1583 server can be made to always broadcast its responses to clients by
1584 setting this flag to 'on' for the relevant scope; relevant scopes would be
1585 inside a conditional statement, as a parameter for a class, or as a parameter
1586 for a host declaration.   To avoid creating excess broadcast traffic on your
1587 network, we recommend that you restrict the use of this option to as few
1588 clients as possible.   For example, the Microsoft DHCP client is known not
1589 to have this problem, as are the OpenTransport and ISC DHCP clients.
1590 .RE
1591 .PP
1592 The
1593 .I always-reply-rfc1048
1594 statement
1595 .RS 0.25i
1596 .PP
1597 .B always-reply-rfc1048 \fIflag\fR\fB;\fR
1598 .PP
1599 Some BOOTP clients expect RFC1048-style responses, but do not follow
1600 RFC1048 when sending their requests.   You can tell that a client is
1601 having this problem if it is not getting the options you have
1602 configured for it and if you see in the server log the message
1603 "(non-rfc1048)" printed with each BOOTREQUEST that is logged.
1604 .PP
1605 If you want to send rfc1048 options to such a client, you can set the
1606 .B always-reply-rfc1048
1607 option in that client's host declaration, and the DHCP server will
1608 respond with an RFC-1048-style vendor options field.   This flag can
1609 be set in any scope, and will affect all clients covered by that
1610 scope.
1611 .RE
1612 .PP
1613 The
1614 .I authoritative
1615 statement
1616 .RS 0.25i
1617 .PP
1618 .B authoritative;
1619 .PP
1620 .B not authoritative;
1621 .PP
1622 The DHCP server will normally assume that the configuration
1623 information about a given network segment is not known to be correct
1624 and is not authoritative.  This is so that if a naive user installs a
1625 DHCP server not fully understanding how to configure it, it does not
1626 send spurious DHCPNAK messages to clients that have obtained addresses
1627 from a legitimate DHCP server on the network.
1628 .PP
1629 Network administrators setting up authoritative DHCP servers for their
1630 networks should always write \fBauthoritative;\fR at the top of their
1631 configuration file to indicate that the DHCP server \fIshould\fR send
1632 DHCPNAK messages to misconfigured clients.   If this is not done,
1633 clients will be unable to get a correct IP address after changing
1634 subnets until their old lease has expired, which could take quite a
1635 long time.
1636 .PP
1637 Usually, writing \fBauthoritative;\fR at the top level of the file
1638 should be sufficient.   However, if a DHCP server is to be set up so
1639 that it is aware of some networks for which it is authoritative and
1640 some networks for which it is not, it may be more appropriate to
1641 declare authority on a per-network-segment basis.
1642 .PP
1643 Note that the most specific scope for which the concept of authority
1644 makes any sense is the physical network segment - either a
1645 shared-network statement or a subnet statement that is not contained
1646 within a shared-network statement.  It is not meaningful to specify
1647 that the server is authoritative for some subnets within a shared
1648 network, but not authoritative for others, nor is it meaningful to
1649 specify that the server is authoritative for some host declarations
1650 and not others.
1651 .RE
1652 .PP
1653 The \fIboot-unknown-clients\fR statement
1654 .RS 0.25i
1655 .PP
1656 .B boot-unknown-clients \fIflag\fB;\fR
1657 .PP
1658 If the \fIboot-unknown-clients\fR statement is present and has a value
1659 of \fIfalse\fR or \fIoff\fR, then clients for which there is no
1660 .I host
1661 declaration will not be allowed to obtain IP addresses.   If this
1662 statement is not present or has a value of \fItrue\fR or \fIon\fR,
1663 then clients without host declarations will be allowed to obtain IP
1664 addresses, as long as those addresses are not restricted by
1665 .I allow
1666 and \fIdeny\fR statements within their \fIpool\fR declarations.
1667 .RE
1668 .PP
1669 The \fIddns-hostname\fR statement
1670 .RS 0.25i
1671 .PP
1672 .B ddns-hostname \fIname\fB;\fR
1673 .PP
1674 The \fIname\fR parameter should be the hostname that will be used in
1675 setting up the client's A and PTR records.   If no ddns-hostname is
1676 specified in scope, then the server will derive the hostname
1677 automatically, using an algorithm that varies for each of the
1678 different update methods.
1679 .RE
1680 .PP
1681 The \fIddns-domainname\fR statement
1682 .RS 0.25i
1683 .PP
1684 .B ddns-domainname \fIname\fB;\fR
1685 .PP
1686 The \fIname\fR parameter should be the domain name that will be
1687 appended to the client's hostname to form a fully-qualified
1688 domain-name (FQDN).
1689 .RE
1690 .PP
1691 The \fIddns-rev-domainname\fR statement
1692 .RS 0.25i
1693 .PP
1694 .B ddns-rev-domainname \fIname\fB;\fR
1695 The \fIname\fR parameter should be the domain name that will be
1696 appended to the client's reversed IP address to produce a name for use
1697 in the client's PTR record.   By default, this is "in-addr.arpa.", but
1698 the default can be overridden here.
1699 .PP
1700 The reversed IP address to which this domain name is appended is
1701 always the IP address of the client, in dotted quad notation, reversed
1702 - for example, if the IP address assigned to the client is
1703 10.17.92.74, then the reversed IP address is 74.92.17.10.   So a
1704 client with that IP address would, by default, be given a PTR record
1705 of 10.17.92.74.in-addr.arpa.
1706 .RE
1707 .PP
1708 The \fIddns-update-style\fR parameter
1709 .RS 0.25i
1710 .PP
1711 .B ddns-update-style \fIstyle\fB;\fR
1712 .PP
1713 The
1714 .I style
1715 parameter must be one of \fBad-hoc\fR, \fBinterim\fR or \fBnone\fR.
1716 The \fIddns-update-style\fR statement is only meaningful in the outer
1717 scope - it is evaluated once after reading the dhcpd.conf file, rather
1718 than each time a client is assigned an IP address, so there is no way
1719 to use different DNS update styles for different clients.
1720 .RE
1721 .PP
1722 .B The  
1723 .I ddns-updates
1724 .B statement
1725 .RS 0.25i
1726 .PP
1727  \fBddns-updates \fIflag\fR\fB;\fR
1728 .PP
1729 The \fIddns-updates\fR parameter controls whether or not the server will
1730 attempt to do a DNS update when a lease is confirmed.   Set this to \fIoff\fR
1731 if the server should not attempt to do updates within a certain scope.
1732 The \fIddns-updates\fR parameter is on by default.   To disable DNS
1733 updates in all scopes, it is preferable to use the
1734 \fIddns-update-style\fR statement, setting the style to \fInone\fR.
1735 .RE
1736 .PP
1737 The
1738 .I default-lease-time
1739 statement
1740 .RS 0.25i
1741 .PP
1742 .B default-lease-time \fItime\fR\fB;\fR
1743 .PP
1744 .I Time
1745 should be the length in seconds that will be assigned to a lease if
1746 the client requesting the lease does not ask for a specific expiration
1747 time.
1748 .RE
1749 .PP
1750 The
1751 .I dynamic-bootp-lease-cutoff
1752 statement
1753 .RS 0.25i
1754 .PP
1755 .B dynamic-bootp-lease-cutoff \fIdate\fB;\fR
1756 .PP
1757 The \fIdynamic-bootp-lease-cutoff\fR statement sets the ending time
1758 for all leases assigned dynamically to BOOTP clients.  Because BOOTP
1759 clients do not have any way of renewing leases, and don't know that
1760 their leases could expire, by default dhcpd assignes infinite leases
1761 to all BOOTP clients.  However, it may make sense in some situations
1762 to set a cutoff date for all BOOTP leases - for example, the end of a
1763 school term, or the time at night when a facility is closed and all
1764 machines are required to be powered off.
1765 .PP
1766 .I Date
1767 should be the date on which all assigned BOOTP leases will end.  The
1768 date is specified in the form:
1769 .PP
1770 .ce 1
1771 W YYYY/MM/DD HH:MM:SS
1772 .PP
1773 W is the day of the week expressed as a number
1774 from zero (Sunday) to six (Saturday).  YYYY is the year, including the
1775 century.  MM is the month expressed as a number from 1 to 12.  DD is
1776 the day of the month, counting from 1.  HH is the hour, from zero to
1777 23.  MM is the minute and SS is the second.  The time is always in
1778 Coordinated Universal Time (UTC), not local time.
1779 .RE
1780 .PP
1781 The
1782 .I dynamic-bootp-lease-length
1783 statement
1784 .RS 0.25i
1785 .PP
1786 .B dynamic-bootp-lease-length\fR \fIlength\fR\fB;\fR
1787 .PP
1788 The \fIdynamic-bootp-lease-length\fR statement is used to set the
1789 length of leases dynamically assigned to BOOTP clients.   At some
1790 sites, it may be possible to assume that a lease is no longer in
1791 use if its holder has not used BOOTP or DHCP to get its address within
1792 a certain time period.   The period is specified in \fIlength\fR as a
1793 number of seconds.   If a client reboots using BOOTP during the
1794 timeout period, the lease duration is reset to \fIlength\fR, so a
1795 BOOTP client that boots frequently enough will never lose its lease.
1796 Needless to say, this parameter should be adjusted with extreme
1797 caution.
1798 .RE
1799 .PP
1800 The
1801 .I filename
1802 statement
1803 .RS 0.25i
1804 .PP
1805 .B filename\fR \fB"\fR\fIfilename\fR\fB";\fR
1806 .PP
1807 The \fIfilename\fR statement can be used to specify the name of the
1808 initial boot file which is to be loaded by a client.  The
1809 .I filename
1810 should be a filename recognizable to whatever file transfer protocol
1811 the client can be expected to use to load the file.
1812 .RE
1813 .PP
1814 The
1815 .I fixed-address
1816 statement
1817 .RS 0.25i
1818 .PP
1819 .B fixed-address address\fR [\fB,\fR \fIaddress\fR ... ]\fB;\fR
1820 .PP
1821 The \fIfixed-address\fR statement is used to assign one or more fixed
1822 IP addresses to a client.  It should only appear in a \fIhost\fR
1823 declaration.  If more than one address is supplied, then when the
1824 client boots, it will be assigned the address which corresponds to the
1825 network on which it is booting.  If none of the addresses in the
1826 \fIfixed-address\fR statement are on the network on which the client
1827 is booting, that client will not match the \fIhost\fR declaration
1828 containing that \fIfixed-address\fR statement.  Each \fIaddress\fR
1829 should be either an IP address or a domain name which resolves to one
1830 or more IP addresses.
1831 .RE
1832 .PP
1833 The
1834 .I get-lease-hostnames
1835 statement
1836 .RS 0.25i
1837 .PP
1838 .B get-lease-hostnames\fR \fIflag\fR\fB;\fR
1839 .PP
1840 The \fIget-lease-hostnames\fR statement is used to tell dhcpd whether
1841 or not to look up the domain name corresponding to the IP address of
1842 each address in the lease pool and use that address for the DHCP
1843 \fIhostname\fR option.  If \fIflag\fR is true, then this lookup is
1844 done for all addresses in the current scope.   By default, or if
1845 \fIflag\fR is false, no lookups are done.
1846 .RE
1847 .PP
1848 The 
1849 .I hardware
1850 statement
1851 .RS 0.25i
1852 .PP
1853 .B hardware \fIhardware-type hardware-address\fB;\fR
1854 .PP
1855 In order for a BOOTP client to be recognized, its network hardware
1856 address must be declared using a \fIhardware\fR clause in the
1857 .I host
1858 statement.
1859 .I hardware-type
1860 must be the name of a physical hardware interface type.   Currently,
1861 only the
1862 .B ethernet
1863 and
1864 .B token-ring
1865 types are recognized, although support for a
1866 .B fddi
1867 hardware type (and others) would also be desirable.
1868 The
1869 .I hardware-address
1870 should be a set of hexadecimal octets (numbers from 0 through ff)
1871 seperated by colons.   The \fIhardware\fR statement may also be used
1872 for DHCP clients.
1873 .RE
1874 .PP
1875 The
1876 .I lease-file-name
1877 statement
1878 .RS 0.25i
1879 .PP
1880 .B lease-file-name \fIname\fB;\fR
1881 .PP
1882 .I Name
1883 should be the name of the DHCP server's lease file.   By default, this
1884 is DBDIR/dhcpd.leases.   This statement \fBmust\fR appear in the outer
1885 scope of the configuration file - if it appears in some other scope,
1886 it will have no effect.
1887 .RE
1888 .PP
1889 The
1890 .I local-port
1891 statement
1892 .RS 0.25i
1893 .PP
1894 .B local-port \fIport\fB;\fR
1895 .PP
1896 This statement causes the DHCP server to listen for DHCP requests on
1897 the UDP port specified in \fIport\fR, rather than on port 67.
1898 .RE
1899 .PP
1900 The
1901 .I log-facility
1902 statement
1903 .RS 0.25i
1904 .PP
1905 .B log-facility \fIfacility\fB;\fR
1906 .PP
1907 This statement causes the DHCP server to do all of its logging on the
1908 specified log facility once the dhcpd.conf file has been read.   By
1909 default the DHCP server logs to the daemon facility.   Possible log
1910 facilities include auth, authpriv, cron, daemon, ftp, kern, lpr, mail,
1911 mark, news, ntp, security, syslog, user, uucp, and local0 through
1912 local7.   Not all of these facilities are available on all systems,
1913 and there may be other facilities available on other systems.
1914 .PP
1915 In addition to setting this value, you may need to modify your
1916 .I syslog.conf
1917 file to configure logging of the DHCP server.   For example, you might
1918 add a line like this:
1919 .PP
1920 .nf
1921         local7.debug /var/log/dhcpd.log
1922 .fi
1923 .PP
1924 The syntax of the \fIsyslog.conf\fR file may be different on some
1925 operating systems - consult the \fIsyslog.conf\fR manual page to be
1926 sure.  To get syslog to start logging to the new file, you must first
1927 create the file with correct ownership and permissions (usually, the
1928 same owner and permissions of your /var/log/messages or
1929 /usr/adm/messages file should be fine) and send a SIGHUP to syslogd.
1930 Some systems support log rollover using a shell script or program
1931 called newsyslog or logrotate, and you may be able to configure this
1932 as well so that your log file doesn't grow uncontrollably.
1933 .PP
1934 Because the \fIlog-facility\fR setting is controlled by the dhcpd.conf
1935 file, log messages printed while parsing the dhcpd.conf file or before
1936 parsing it are logged to the default log facility.  To prevent this,
1937 see the README file included with this distribution, which describes
1938 how to change the default log facility.  When this parameter is used,
1939 the DHCP server prints its startup message a second time after parsing
1940 the configuration file, so that the log will be as complete as
1941 possible.
1942 .RE
1943 .PP
1944 The
1945 .I max-lease-time
1946 statement
1947 .RS 0.25i
1948 .PP
1949 .B max-lease-time \fItime\fR\fB;\fR
1950 .PP
1951 .I Time
1952 should be the maximum length in seconds that will be assigned to a
1953 lease.   The only exception to this is that Dynamic BOOTP lease
1954 lengths, which are not specified by the client, are not limited by
1955 this maximum.
1956 .RE
1957 .PP
1958 The
1959 .I min-lease-time
1960 statement
1961 .RS 0.25i
1962 .PP
1963 .B min-lease-time \fItime\fR\fB;\fR
1964 .PP
1965 .I Time
1966 should be the minimum length in seconds that will be assigned to a
1967 lease.
1968 .RE
1969 .PP
1970 The
1971 .I min-secs
1972 statement
1973 .RS 0.25i
1974 .PP
1975 .B min-secs \fIseconds\fR\fB;\fR
1976 .PP
1977 .I Seconds
1978 should be the minimum number of seconds since a client began trying to
1979 acquire a new lease before the DHCP server will respond to its request.
1980 The number of seconds is based on what the client reports, and the maximum
1981 value that the client can report is 255 seconds.   Generally, setting this
1982 to one will result in the DHCP server not responding to the client's first
1983 request, but always responding to its second request.
1984 .PP
1985 This can be used
1986 to set up a secondary DHCP server which never offers an address to a client
1987 until the primary server has been given a chance to do so.   If the primary
1988 server is down, the client will bind to the secondary server, but otherwise
1989 clients should always bind to the primary.   Note that this does not, by
1990 itself, permit a primary server and a secondary server to share a pool of
1991 dynamically-allocatable addresses.
1992 .RE
1993 .PP
1994 The
1995 .I next-server
1996 statement
1997 .RS 0.25i
1998 .PP
1999 .B next-server\fR \fIserver-name\fR\fB;\fR
2000 .PP
2001 The \fInext-server\fR statement is used to specify the host address of
2002 the server from which the initial boot file (specified in the
2003 \fIfilename\fR statement) is to be loaded.   \fIServer-name\fR should
2004 be a numeric IP address or a domain name.   If no \fInext-server\fR
2005 parameter applies to a given client, the DHCP server's IP address is
2006 used.
2007 .RE
2008 .PP
2009 The
2010 .I omapi-port
2011 statement
2012 .RS 0.25i
2013 .PP
2014 .B omapi-port\fR \fIport\fR\fB;\fR
2015 .PP
2016 The \fIomapi-port\fR statement causes the DHCP server to listen for
2017 OMAPI connections on the specified port.   This statement is required
2018 to enable the OMAPI protocol, which is used to examine and modify the
2019 state of the DHCP server as it is running.
2020 .RE
2021 .PP
2022 The
2023 .I one-lease-per-client
2024 statement
2025 .RS 0.25i
2026 .PP
2027 .B one-lease-per-client \fIflag\fR\fB;\fR
2028 .PP
2029 If this flag is enabled, whenever a client sends a DHCPREQUEST for a
2030 particular lease, the server will automatically free any other leases
2031 the client holds.   This presumes that when the client sends a
2032 DHCPREQUEST, it has forgotten any lease not mentioned in the
2033 DHCPREQUEST - i.e., the client has only a single network interface
2034 .I and
2035 it does not remember leases it's holding on networks to which it is
2036 not currently attached.   Neither of these assumptions are guaranteed
2037 or provable, so we urge caution in the use of this statement.
2038 .RE
2039 .PP
2040 The
2041 .I pid-file-name
2042 statement
2043 .RS 0.25i
2044 .PP
2045 .B pid-file-name
2046 .I name\fR\fB;\fR
2047 .PP
2048 .I Name
2049 should be the name of the DHCP server's process ID file.   This is the
2050 file in which the DHCP server's process ID is stored when the server
2051 starts.   By default, this is RUNDIR/dhcpd.pid.   Like the
2052 lease-file-name statement, this statement must appear in the outer scope
2053 of the configuration file.
2054 .RE
2055 .PP
2056 The
2057 .I ping-check
2058 statement
2059 .RS 0.25i
2060 .PP
2061 .B ping-check
2062 .I flag\fR\fB;\fR
2063 .PP
2064 When the DHCP server is considering dynamically allocating an IP
2065 address to a client, it first sends an ICMP Echo request (a \fIping\fR)
2066 to the address being assigned.   It waits for a second, and if no
2067 ICMP Echo response has been heard, it assigns the address.   If a
2068 response \fIis\fR heard, the lease is abandoned, and the server does
2069 not respond to the client.
2070 .PP
2071 This \fIping check\fR introduces a one-second delay in responding to
2072 DHCPDISCOVER messages, which can be a problem for some clients.   The
2073 ping-check configuration parameter can be used to control checking -
2074 if its value is false, no ping check is done.
2075 .RE
2076 .PP
2077 The
2078 .I server-identifier
2079 statement
2080 .RS 0.25i
2081 .PP
2082 .B server-identifier \fIhostname\fR\fB;\fR
2083 .PP
2084 The server-identifier statement can be used to define the value that
2085 is sent in the DHCP Server Identifier option for a given scope.   The
2086 value specified \fBmust\fR be an IP address for the DHCP server, and
2087 must be reachable by all clients served by a particular scope.
2088 .PP
2089 The use of the server-identifier statement is not recommended - the only
2090 reason to use it is to force a value other than the default value to be
2091 sent on occasions where the default value would be incorrect.   The default
2092 value is the first IP address associated with the physical network interface
2093 on which the request arrived.
2094 .PP
2095 The usual case where the
2096 \fIserver-identifier\fR statement needs to be sent is when a physical
2097 interface has more than one IP address, and the one being sent by default
2098 isn't appropriate for some or all clients served by that interface.
2099 Another common case is when an alias is defined for the purpose of
2100 having a consistent IP address for the DHCP server, and it is desired
2101 that the clients use this IP address when contacting the server.
2102 .PP
2103 Supplying a value for the dhcp-server-identifier option is equivalent
2104 to using the server-identifier statement.
2105 .RE
2106 .PP
2107 The
2108 .I server-name
2109 statement
2110 .RS 0.25i
2111 .PP
2112 .B server-name "\fIname\fB";\fR
2113 .PP
2114 The \fIserver-name\fR statement can be used to inform the client of
2115 the name of the server from which it is booting.   \fIName\fR should
2116 be the name that will be provided to the client.
2117 .RE
2118 .PP
2119 The
2120 .I site-option-space
2121 statement
2122 .RS 0.25i
2123 .PP
2124 .B site-option-space "\fIname\fB";\fR
2125 .PP
2126 The \fIsite-option-space\fR statement can be used to determine from
2127 what option space site-local options will be taken.   This can be used
2128 in much the same way as the \fIvendor-option-space\fR statement.
2129 Site-local options in DHCP are those options whose numeric codes are
2130 greater than 128.   These options are intended for site-specific
2131 uses, but are frequently used by vendors of embedded hardware that
2132 contains DHCP clients.   Because site-specific options are allocated
2133 on an ad hoc basis, it is quite possible that one vendor's DHCP client
2134 might use the same option code that another vendor's client uses, for
2135 different purposes.   The \fIsite-option-space\fR option can be used
2136 to assign a different set of site-specific options for each such
2137 vendor, using conditional evaluation (see \fIdhcp-eval.5\fR for
2138 details).
2139 .RE
2140 .PP
2141 The
2142 .I stash-agent-options
2143 statement
2144 .RS 0.25i
2145 .PP
2146 .B stash-agent-options \fIflag\fB;\fR
2147 .PP
2148 If the \fIstash-agent-options\fR parameter is true for a given client,
2149 the server will record the relay agent information options sent during
2150 the client's initial DHCPREQUEST message when the client was in the
2151 SELECTING state and behave as if those options are included in all
2152 subsequent DHCPREQUEST messages sent in the RENEWING state.   This
2153 works around a problem with relay agent information options, which is
2154 that they usually not appear in DHCPREQUEST messages sent by the
2155 client in the RENEWING state, because such messages are unicast
2156 directly to the server and not sent through a relay agent.
2157 .RE
2158 .PP
2159 The
2160 .I update-optimization
2161 statement
2162 .RS 0.25i
2163 .PP
2164 .B update-optimization \fIflag\fB;\fR
2165 .PP
2166 If the \fIupdate-optimization\fR parameter is false for a given client,
2167 the server will attempt a DNS update for that client each time the
2168 client renews its lease, rather than only attempting an update when it
2169 appears to be necessary.   This will allow the DNS to heal from
2170 database inconsistencies more easily, but the cost is that the DHCP
2171 server must do many more DNS updates.   We recommend leaving this option
2172 enabled, which is the default.  This option only affects the behavior of
2173 the interim DNS update scheme, and has no effect on the ad-hoc DNS update
2174 scheme.   If this parameter is not specified, or is true, the DHCP server
2175 will only update when the client information changes, the client gets a
2176 different lease, or the client's lease expires.
2177 .RE
2178 .PP
2179 The
2180 .I update-static-leases
2181 statement
2182 .RS 0.25i
2183 .PP
2184 .B update-static-leases \fIflag\fB;\fR
2185 .PP
2186 The \fIupdate-static-leases\fR flag, if enabled, causes the DHCP
2187 server to do DNS updates for clients even if those clients are being
2188 assigned their IP address using a \fIfixed-address\fR statement - that
2189 is, the client is being given a static assignment.   This can only
2190 work with the \fIinterim\fR DNS update scheme.   It is not
2191 recommended because the DHCP server has no way to tell that the update
2192 has been done, and therefore will not delete the record when it is not
2193 in use.   Also, the server must attempt the update each time the
2194 client renews its lease, which could have a significant performance
2195 impact in environments that place heavy demands on the DHCP server.
2196 .RE
2197 .PP
2198 The
2199 .I use-host-decl-names
2200 statement
2201 .RS 0.25i
2202 .PP
2203 .B use-host-decl-names \fIflag\fB;\fR
2204 .PP
2205 If the \fIuse-host-decl-names\fR parameter is true in a given scope,
2206 then for every host declaration within that scope, the name provided
2207 for the host declaration will be supplied to the client as its
2208 hostname.   So, for example,
2209 .PP
2210 .nf
2211     group {
2212       use-host-decl-names on;
2213
2214       host joe {
2215         hardware ethernet 08:00:2b:4c:29:32;
2216         fixed-address joe.fugue.com;
2217       }
2218     }
2219
2220 is equivalent to
2221
2222       host joe {
2223         hardware ethernet 08:00:2b:4c:29:32;
2224         fixed-address joe.fugue.com;
2225         option host-name "joe";
2226       }
2227 .fi
2228 .PP
2229 An \fIoption host-name\fR statement within a host declaration will
2230 override the use of the name in the host declaration.
2231 .PP
2232 It should be noted here that most DHCP clients completely ignore the
2233 host-name option sent by the DHCP server, and there is no way to
2234 configure them not to do this.   So you generally have a choice of
2235 either not having any hostname to client IP address mapping that the
2236 client will recognize, or doing DNS updates.   It is beyond
2237 the scope of this document to describe how to make this
2238 determination.
2239 .RE
2240 .PP
2241 The
2242 .I use-lease-addr-for-default-route
2243 statement
2244 .RS 0.25i
2245 .PP
2246 .B use-lease-addr-for-default-route \fIflag\fR\fB;\fR
2247 .PP
2248 If the \fIuse-lease-addr-for-default-route\fR parameter is true in a
2249 given scope, then instead of sending the value specified in the
2250 routers option (or sending no value at all), the IP address of the
2251 lease being assigned is sent to the client.   This supposedly causes
2252 Win95 machines to ARP for all IP addresses, which can be helpful if
2253 your router is configured for proxy ARP.   The use of this feature is
2254 not recommended, because it won't work for many DHCP clients.
2255 .RE
2256 .PP
2257 The
2258 .I vendor-option-space
2259 statement
2260 .RS 0.25i
2261 .PP
2262 .B vendor-option-space \fIstring\fR\fB;\fR
2263 .PP
2264 The \fIvendor-option-space\fR parameter determines from what option
2265 space vendor options are taken.   The use of this configuration
2266 parameter is illustrated in the \fIdhcp-options(5)\fR manual page, in
2267 the \fIVENDOR ENCAPSULATED OPTIONS\fR section.
2268 .RE
2269 .SH SETTING PARAMETER VALUES USING EXPRESSIONS
2270 Sometimes it's helpful to be able to set the value of a DHCP server
2271 parameter based on some value that the client has sent.   To do this,
2272 you can use expression evaluation.   The 
2273 .B dhcp-eval(5)
2274 manual page describes how to write expressions.   To assign the result
2275 of an evaluation to an option, define the option as follows:
2276 .nf
2277 .sp 1
2278   \fImy-parameter \fB= \fIexpression \fB;\fR
2279 .fi
2280 .PP
2281 For example:
2282 .nf
2283 .sp 1
2284   ddns-hostname = binary-to-ascii (16, 8, "-",
2285                                    substring (hardware, 1, 6));
2286 .fi
2287 .SH REFERENCE: OPTION STATEMENTS
2288 DHCP option statements are documented in the
2289 .B dhcp-options(5)
2290 manual page.
2291 .SH REFERENCE: EXPRESSIONS
2292 Expressions used in DHCP option statements and elsewhere are
2293 documented in the
2294 .B dhcp-eval(5)
2295 manual page.
2296 .SH SEE ALSO
2297 dhcpd(8), dhcpd.leases(5), dhcp-options(5), dhcp-eval(5), RFC2132, RFC2131.
2298 .SH AUTHOR
2299 .B dhcpd.conf(5)
2300 was written by Ted Lemon
2301 under a contract with Vixie Labs.   Funding
2302 for this project was provided by the Internet Software Consortium.
2303 Information about the Internet Software Consortium can be found at
2304 .B http://www.isc.org.