Script for updating Dynamic DNS entry on ZoneEdit.com using SME Server Version 1.0c, 22 January 2005 Rick Jones, Active Service Consulting Ltd, UK History: 1.0 ZoneEdit script 1.0a Added checkdns.sh 1.0b Improved checkdns.sh when unexpected results returned 1.0c Changed result processing to allow for CR-LF line endings and avoid errors if empty result Also switched to https because of clear-text auth The accompanying file enables SME to update a dynamic DNS entry on zoneedit.com. The file "zoneedit" should be copied into /sbin/e-smith/dynamic-dns. There are two ways to get SME to use this file. The simplest is to rename it to "custom", and configure SME's dynamic DNS settings to use "custom" as the DNS service. Alternatively you can manually change SME's configuration so that "zoneedit" is the name of the dynamic DNS service. To do this run the following command: /sbin/e-smith/db configuration set DynDNS service \ Account your-account Password your-password Service zoneedit status enabled (replace your-account & your-password with your own login to ZoneEdit) This saves you going through the full SME re-config. You may want to edit the zoneedit script. As supplied it updates the ZE entry for the SME server's primary domain. If your ZE domain is different, you can set the value of DOMAIN in the script directly. You can also have the script update one or more subdomain names in addition to, or instead of, the base domain name. Set the values of SUBDOMS and HOSTS appropriately, as described in the script comments. [ Note that an alternative way to achieve the same result is to configure all but one of your entries on ZE as aliases (CNAME records), then just update the single IP-address (A record). ] Results of all actions are logged to "messages", reformatted to be readable. If you make the script update more than one address, the each result will be logged as a separate line. Extra script in 1.0a and above Very occasionally I've experienced the DNS update fail after connection. This can be a problem because it only makes one attempt after ip-up, and if it doesn't work then the SME server is not accessible from the Internet. The script checkdns.sh can be added as a cron job (either make it executable or run it as "sh checkdns.sh") and will check if the IP returned from the appropriate DNS server is correct. If not it will invoke the updater. I run this every hour, as I can live with being out that long; run it more frequently if you need to. If you run it as a user cron job in the admin account, then admin will be emailed if an update actually takes place. This is a handy way of getting early warning of perhaps bigger problems. Note that this is not specific to ZE, it will work with ANY dynamic DNS service that uses the SME hooks. Just make sure that the value of DNSSERVER in the script is appropriate for the DNS service you use. This works great for me, hope it's useful to you too! Rick Jones rick@activeservice.co.uk