Notes on Michael Stella's dhcp_dns


dhcp-dns is a nifty little app written by Michael Stella that updates a DJBDNS's tinydns data file so as new machiens are brought on-line with DHCP configurations, they automatically get added to DNS.

I administer a 900 user network, and I don't use this there, and I don't really miss it. There, servers are servers, workstations are workstations, and there isn't a lot of confusion. However, at home, I have around 20 computers running at any time, and incredible amounts of "churn" -- new computers coming in and going out constantly. As virtually all of these machines are Unix variants, they don't distinguish between servers and workstaions, so I end up either trying to recall IP addresses or maintaining my in-house DNS server.

At home, this program is WONDERFUL, I love it.

However, the docs are a little skimpy, and since I keep having to figure this out myself, I figured I'd post a few nots on the app here.

Platform support: I'm not sure what platform dhcp-dns was written for, but it works without modification on OpenBSD without adding any software other than DJBDNS. It works fine with OpenBSD's included DHCP server (derived from ISC's dhcpd, but cleaned up significantly).


Install AFTER the basic setup and config of DJBDNS and dhcpd. Unpack the dhcp_dns-1.1.0.tgz file, doesn't really matter where. It creates its own directory, dhcpd_dns, and will copy stuff where it needs to go.

Edit the Makefile for the paths on your system. This is where I get confused, as the path names were not intuitive to me, and the "default" directories are probably dead wrong for ALL users. I can't say I disagree with this philosophy, as it will make sure you actually enter correct info, not "accept the defaults" blindly. If you try to use the defaults, you end up dropping stuff harmlessly into /tmp directory. So, here is a slightly more detailed description of the Makefile variables:

PREFIX: This is the directory for third-party apps, or at least, the DJBDNS apps. In my case, this is /usr/local. This is the one that always gets me, I want to put /usr/local/bin, or /var, or something else..wrong.

DOMAIN: Your internal domain name. In my case, I use "", but I can say with certainty, this is NOT right for you.

TINYDNSPATH: Path to your real TinyDNS directory. DJB suggests /etc/tinydns, but my skin crawls at the idea of putting log files in the /etc directory, so I use /var/tinydns. Use what is appropriate for your system.

DNSCACHEPATH: as above, the path to your real DNSCache directory. Again, DJB suggests /etc/dnscache, I use /var/dnscache.

LEASEFILE: Path to the leasefile created by your system's DHCP server. Curiously, the "default" is correct for my system...your milage may vary.

Running the program

I use the following in my /etc/rc.local to start the program on my DNS/DHCP system:
echo  ' dns-dhcp.'
(cd /var/tinydns/root && /usr/local/bin/ >/var/log/dnsdhcp & )
My first reaction is the "cd /var/tinydns/root" should not be required, but the script appears to need to be run from the directory the tinydns data files are in. However, this program could be used to administer several different DHCP and DNS networks on one machine, so I can see reasons why this is the case. However, I think this needs documenting...

After that, the program Just Runs, assuming you didn't do something really stupid, like transpose two characters in your DOMAIN variable, and spend too long trying to see the difference between "" and ""... (oops)

Back to Technical Guides
Holland Consulting home page
Contact Holland Consulting

since November 24, 2006

Copyright  2006, Nick Holland, Holland Consulting

$Id: dhcp-dns.html,v 1.2 2006/11/26 14:56:30 nick Exp $