calvin at dodgeoffice.net
Wed Jan 10 16:57:34 GMT 2001
Ries van Twisk wrote:
> Is there any way I can update the dns database as soon as the
> DHCP deamon is giving away a IP address?
I use the following script:
firsttime=$(ls -l --full-time /var/state/dhcp/dhcpd.leases)
while [ 1 ];
secondtime=$(ls -l --full-time /var/state/dhcp/dhcpd.leases)
if [ "$secondtime" != "$firsttime" ];
logger DHCP-DNS updated DNS
You'll want to edit the "/var/dhcp-dns/" and "/var/state/dhcp/" lines to fit your system (yes, I could use variables instead).
The script checks the "dhcpd.leases" file every 5 seconds, which I think should be often enough for you. If not, then edit the "sleep 5" line to suit your desires.
More information about the samba