ddns-fwd-name exists. If it does, this indicates that the DHCP server has successfully
done a DNS update for this client. The
commit code also checks to see whether it has
already added an MX record, by checking the value of the
ddns-mx-name variable.
The
commit event happens every time the lease is renewed, not just the first time, so
if the
commit code didn’t check, it would re-add the MX record whenever the lease
was renewed.
If the
commit code hasn’t yet added an MX record, it tries to add it. The code in
Example 20.17 tests the result of the update by using the
switch statement. If the
result is
NOERROR, meaning that the update succeeded, the commit code sets the ddns-
mx-name variable. This allows it to remember to remove the MX record later and also
not to keep trying to add it after it has been added for the first time. The
commit
code then adds code to execute when the lease expires or is released, using the
expiry event and the release event. The expiry and release event code deletes the
MX record when the lease expires or is released. This event also unsets the
ddns-mx-
name variable because if it is not unset, it remains on the lease even though the lease
has expired.
Summary
The ISC DHCP server provides a powerful collection of tools you can use to differen-
tiate between clients. You can instruct the server to return different options to differ-
ent clients based on what the clients send.
Options can be grouped into classes. You can do this either by testing for options
that many clients send, by having each client’s scope determine its class (for
example, with
host declarations), by predefining subclasses, or by configuring the
server to automatically spawn new subclasses. You can control address allocation
policy based on the classes of which clients are members, as well as whether clients
have
host declarations and whether they use BOOTP or DHCP. You can also limit the
number of members of a particular class that can hold a lease at the same time. To
automate per-class lease limits, you can configure the server to generate new
subclasses as it runs.
Several options are designed specifically for use in classifying clients. Clients can be
configured to send the
user class option to indicate what class of user is using
them, although the
user class option is unfortunately not widely supported. Some
vendors’ clients also use the
vendor class identifier option to identify the vendor
that sent the option. The
vendor class identifier option can also be used to
determine the contents of the
vendor-specific information option.
You can program the server to take action when various events happen in the life-
time of a lease and to store variables on the lease for use when events occur.
Summary 353
024 3273 CH20 10/3/02 5:00 PM Page 353