How The ISC DHCP Server Derives Host Names


Like most DHCP implementations, the ISC DHCP server supports sending host names in response to a DHCP DISCOVERY message. The host name is sent when DHCP option 12 is requested by the client, and the name is derived from one of two locations:

  1. The ISC DHCP server will look up the IP address in DNS
  2. The server will use an administratively defined host name

To configure ISC DHCP to set the host-name option based on DNS data, you can set the “get-lease-hostnames” directive to true:

get-lease-hostnames true;

If you are unable to use DNS to derive the host name, you are still in luck. You can specify the name to assign to the client in a host block:

host thecrue {
hardware ethernet 00:24:8c:4e:07:f6;
fixed-address thecrue.prefetch.net";
host-name "thecrue.prefetch.net"
}

In the example above, the host name “thecrue.prefetch.net” will be assigned to the client with mac address 00:24:8c:4e:07:f6. If you have a large number of hosts and you want to use the name that is attached to the host directive, you can use the “use-host-decl-names” directive. Here is an example that enables the directive, and defines two hosts that will get their host name from the entry attached to the host directive:

group {
use-host-decl-names on;

host thecrue {
hardware ethernet 00:24:8c:4e:07:f6;
fixed-address thecrue.prefetch.net";
}

host aic {
hardware ethernet 00:24:8c:4e:07:f7;
fixed-address aic.prefetch.net";
}
}

There a couple of additional options that are useful for integrating ISC DHCP with DNS, but I’ll save those for a future post.

This article was posted by Matty on 2009-07-14 23:07:00 -0400 -0400