KanREN DHCP Seminar November 7-9, 2005

Configuring DDNS

Create a new file called dhcpd.conf-ddns that looks like this, and include it into your main configuration file above your subnets include. Note that the IP address for the DNS server will be the same on each DHCP server, since we're not all running our own DNS.

# Select interim-style updates.

ddns-update-style interim;

# Only the server should update.

deny client-updates;

# Subdomain to update:

ddns-domainname "classroom.kanren.net";

# Secret key shared with DNS server:

key kanren-class-ddns {

algorithm HMAC-MD5.SIG-ALG.REG.INT;

secret "gOoWEibNYveLEoY+mmq9nxIDjebaIlvCRd5TEY8Gqdo=";

}

# Select a zone for name-to-address entries and specify its DNS server.

zone classroom.kanren.net {

primary 192.168.10.253;

key kanren-class-ddns;

}

# Select zones for address-to-name entries and specify their DNS server.

zone 10.168.192.in-addr.arpa {

primary 192.168.10.253;

key kanren-class-ddns;

}

zone 11.168.192.in-addr.arpa {

primary 192.168.10.253;

key kanren-class-ddns;

}

# Select/construct a hostname to register in DDNS.

#

# The first choice is the name of the host declaration for a known host.

#

# The second choice is to build a hostname of the form dhcp-192-168-10-63.

ddns-hostname = pick (

host-decl-name,

concat ("dhcp-", binary-to-ascii (10, 8, "-", leased-address))

);

Test your configuration and restart your server. Then watch your log file in real time:

lab1:/var/named # tail -f /var/log/daemon

And renew your lease. In the log file, you should see a message indicating that DHCP has successfully registered your client's forward record (name-to-address) in DNS. (You'll also see a message indicating that it failed to register the reverse entry, because the server's not set up for it yet.)

Also examine your lease file—it should contain new information about your DDNS settings.

To confirm that the entry is really in DNS, perform a lookup of your client's hostname against the classroom DNS server:

keiths-mac $ nslookup neufeld-mac.classroom.kanren.net 192.168.10.253

Server: 192.168.10.253

Address: 192.168.10.253#53

Name: neufeld-mac.classroom.kanren.net

Address: 192.168.10.63

keiths-mac $ nslookup 192.168.10.63 192.168.10.253

Server: 192.168.10.253

Address: 192.168.10.253#53

63.10.168.192.in-addr.arpa name = neufeld-mac.classroom.kanren.net.

Success at last!

2005-11-07T09:22:35