adventures in ddns part 2

I ended Part 1 with the DNS and DHCP servers configured for Dynamic DNS. Now in this article, we'll learn how to configure the clients.

Setting DDNS up for a DHCP client is pretty simple. If you're running Windows, you're already in luck as Windows will send the computer name as the hostname and DHCP will use that as the A record. (At least this is what happens in an Active Directory environment.)

If you're running Unix or Linux, you'll have to edit the dhclient.conf file. At the top of the file, there will be a couple settings for you to configure. There's only one that's required:

send host-name "hostname";

This is the name that DHCP server will request as the A record.

Like I mentioned, configuring clients is pretty simple. But with all simple things, there's a downside: you have no centralized configuration (unless you poll and pull the hostnames from all the clients). A more centralized solution would be to keep it all on the server side.

To do that, you'll first need to use the nsupdate utility to add the hostname to DNS dynamically. nsupdate will tell DNS about the new record and the change will take place right away -- no reload needed (which is one of the main objectives of DDNS).

An nsupdate conversation looks something like this:

$ nsupdate -y MYKEY:blargh
> server 127.0.0.1
> zone example.com
> update add host1.example.com 36000 IN A 192.168.1.10
> send
> ^D

After you added the host to DNS, add a static entry to DHCP:

host host1 {
    hardware ethernet 0:0:0:0:0:0;
    fixed-address "host1.example.com";
}

So between having all the host information on the clients or storing it all on the server, somehow you should be able to find a happy median in-between.

That's all for now. We'll cover some shortcuts with scripting in the next part!

Tags: , , , ,