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.

Building ISC DHCP 4.X on Solaris hosts

I attempted to upgrade my ISC DHCP installation to dhcp-4.1.1b1 this past weekend, and ran into the following configure error:

$ ./configure –prefix=/bits/software/dhcp-4.1.1b1

checking for a BSD-compatible install... /bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... unsupported
checking for style of include used by make... none
checking dependency style of gcc... none
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

Th config.log had a number of errors similar to the following:

conftest.c:11:19: stdio.h: No such file or directory
conftest.c:12:23: sys/types.h: No such file or directory
conftest.c:13:22: sys/stat.h: No such file or directory

Which are due to missing system headers. I reviewed the list of packages that were installed, and sure enough SUNWhea (this package contains the various header files) was missing. I installed this package as well as a number of others:

$ pkgadd -d . SUNWhea SUNWbinutils SUNWarc SUNWgcc SUNWgccruntime

$ pkgadd -d . SUNWlibsigsegv SUNWgm4 SUNWgnu-automake-110 SUNWaconf

Any everything compiled and installed perfectly.

Installing ISC DHCP version 3.X to a non-standard location

I use the ISC DHCP server to manage IP allocations at home, and to provide the pxegrub handoff location to new systems I’m building. Since my DHCP server has become rather important, I wanted to install it to a file system that was mirrored. To figure out how to do this, I read through the ISC DHCP Makefiles (BIND 4.X uses autoconf, which allows you to set the installation destination with the –prefix option). This led me to the Makefile.conf file, which contains settings that override the global defaults. These overrides include the bin, man and lib directories, and the directory to look for the configuration file. After a minute or two with vi, I added the desired installation destination and proceeded to compile the server. This worked like a charm, and the settings I used are listed below for reference:

$ pwd
/home/matty/dhcp-3.1.2

$ more Makefile.conf

## Defaults...
SCRIPT = none
USERBINDIR = /bits/software/apps/dhcp-3.1.2/bin
BINDIR = /bits/software/apps/dhcp-3.1.2/sbin
CLIENTBINDIR=/bits/software/apps/dhcp-3.1.2/sbin
ADMMANDIR = /bits/software/apps/dhcp-3.1.2/man/cat8
ADMMANEXT = .0
FFMANDIR = /bits/software/apps/dhcp-3.1.0/man/cat5
FFMANEXT = .0
LIBMANDIR = /bits/software/apps/dhcp-3.1.0/man/cat3
LIBMANEXT = .0
USRMANDIR = /bits/software/apps/dhcp-3.1.0/man/cat1



Now you may be asking me why /bits/software/dhcp-3.1.0? Well, bits is a mirrored ZFS pool, and the software in /bits/software/apps is linked into [bin|man|sbin|lib] directories with the incredibly awesome stow package.