The manual Page
Version française
   
index | glossary | news | downloads | links ]
  DHCP-DNS
DHCP
server patch
releasing leases
by IP addresses

 
news
glossary
links
downloads
 
credits
contact
 
 
search
 
last update
19/02/2003
Valid HTML 4.0!
Valid CSS!
Hit-Parade
Mesurez votre audience


  Add Dynamic DNS update support

Introduction

What follows is actually an alternative to the Dynamic DNS update implementation in the latest ISC's DHCP servers. The main interest of this method is that it can be adapted to any DHCP server (insofar as the configuration file is parsable by the perl script) and that one no longer uses cron to call the perl scripts: scripts are directly called on demand by the DHCP server only when it is necessary. This guarantees a very fast update of DNS servers. All the more, the patch is very easy to install.

Goal

It is a matter of giving a DHCP server the capability to update a DNS server's entries according to the requests it recieves and the leases it gives. Thus, a new computer configured recognized by the DHCP server will be immediately registered in the DNS database. On the contrary, when a lease is over or when a computer releases its lease, it will be removed immediately from the DNS entries.

This is quite useful on a network that recieve a lot of connections and DHCP requests (trading premises, campus networks). Each recognized machine will be able to use the mail servers, not the other machines. For securiry reasons, it is highly recommended to register in the DNS entries all authorized machines and to allow access to network resources only to these machines.

What has to be done

The idea is to make the DHCP server call by itself the perl script when it has just updated its lease database.

One needs to patch the source code by inserting a call to the scripts at the end of the C function that updates the lease database. This function, in the IDC's DHCP servers, is called commit_leases (db.c file). One then needs to add the following code at the end of this function:


#if defined (NSUPDATE)
        note ("updating DNS server");
        if (system(NSUPDATE_SCRIPT) != 0)
                note ("updating failed");
#endif
			

note is there to log the call to the script NSUPDATE_SCRIPT.

NSUPDATE_SCRIPT is a constant defined in the includes/dhcpd.h file and that contains the path to the ddns.cron.pl perl script. One must also add the following lines in this file to finalize the patch:


/* The following lines are used to define the script to be
   executed for Dynanic DNS update */
#ifndef NSUPDATE_SCRIPT
#define NSUPDATE_SCRIPT      "/usr/bin/perl /...../ddns.cron.pl"
#endif
			

The ...... must obviously be replaced by the complete path to the ddns.cron.pl perl script.

It is also possible to patch the configure script and the Makefile.conf file used to prepare the compilation, so that it is possible to chose between a classical compilation without the Dynamic DNS update support and an improved version that supports DNS update. One just needs to define the NSUPDATE variable by using the -DNSUPDATE compilation directive for gcc.

printable format printable format



Copyright © 2000-2002 themanualpage.org - This site is submissive to the terms of the GNU GPL and FDL licences.