Automatically Updating Zoneedit Dynamic DNS without additional software

If you are using the ISC DHCP client and dynamic DNS this script can help you update your DDNS entry without the need for any additional software. I use this on a ClarkConnect server to update Zoneedit but with some minor changes it will easily work for other distros and services.

Basically you just create or edit the /etc/dhclient-exit-hooks file to look like the following:


#!/bin/sh

######################################################################

## $Id: sample-etc_dhclient-exit-hooks 8 2006-06-14 19:51:39Z wimpunk $

######################################################################

# The /etc/dhclient-enter-hooks script is run by the ISC DHCP client's standard

# update script whenever dhclient obtains or renews an address.

 echo "$new_routers" > /var/lib/dhcp/dhclient-$interface.routers

 PATH=/usr/sbin:${PATH}

case "$new_ip_address" in

10.*) ;;

172.1[6-9].* | 172.2[0-9].* | 172.3[0-1].*) ;;

192.168.*) ;;

*)

logger -t dhclient IP address changed to $new_ip_address

wget -O - --http-user=YourAcctName --http-passwd=YourPassword 'http://dynamic.zoneedit.com/auth/dynamic.html?host=nameofdomain.com' >/dev/null 2>&1

;;

esac

Replace the obvious bits with your information. If you use a different service you just need to figure out what changes you need to make to the wget line for your specific service.

Now whenever the server gets an IP address the dynamic DNS entry will be automatically updated. No extra software and no spamming the service with timed updates.

0 Responses to “Automatically Updating Zoneedit Dynamic DNS without additional software”


  1. No Comments

Leave a Reply