Combining Dynamic DNS, DHCP and PXE boot

Following on from looking at PXE based installs earlier on in the week, I then moved on to looking at integrating dynamic DNS updates into DHCP (see this article for more details), which is something else I’ve been meaning to look at for some time.

It does greatly simplify the setting of the hostname and domain name on a server when it’s been automatically installed with Debian pre-seeding or Red Hat’s kickstart over the network. This is because both build systems use the reverse DNS entry of the server’s IP address during installations as its hostname.

Thus the host entry in the DHCPd configuration becomes the single location for the details, as in the following example:

host test-001 {

  hardware ethernet 00:0c:29:56:f3:7b;

  option host-name "test-001";

  ddns-hostname "test-001";

  ddns-domainname "local";

}

A first look at PXE based installations

I’ve never really managed to spend the time needed to have a good look at setting up an environment for installing Linux via PXE. However I finally managed to find the time earlier on this week, and so far I’m impressed. I’ve now got the start of a boot menu from which I can install Debian Etch, two different versions of Centos and most importantly the DHCP server co-exists on the same network as my cable router.

The following magic in the dhcpd.conf allows this server to co-exist with another DHCP server, due to PXE clients ignoring DHCP replies which do not contain the filename or next-server options:

deny unknown-clients;

class "pxe" {
  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
}

And finally within a pool definition, the real magic:

allow members of "pxe";
next-server 192.168.1.2;

This allows hosts that boot with the same file name to be grouped together, which should also allow installation of *BSD systems and may be even Windows servers off the same Linux server running ISC DHCPD and TFTP.

I think the next step is to look at automatic installation of Debian and integrating dynamic DNS updates into DHCP, that way it should be possible to get the correct hostname into a Centos VM. However I’m not sure if how it will work with Debian.