Wednesday, August 22, 2012
Linux Make ddclient Work with Multiple Namecheap Domains
If you are using ddclient 3.8.1 or older, and are updating multiple Namecheap domains, there is a possibility it is not working.
If you are updating multiple domains, for example foo.com and foobar.com, along with multiple hostnames for each domain, for example @, www, or mail, ddclient will only update the first hostname it encounters.
For example, if your /etc/ddclient/ddclient.conf looks like the configuration below, during each update only foo.com, www.foo.com, mail.foo.com, and smtp.foobar.com will be updated. foobar.com, www.foobar.com, and mail.foobar.com will not be updated because those hostnames were already checked for the first domain name.
protocol=namecheap, \ server=dynamicdns.park-your-domain.com, \ login=foo.com \ password=faefjawpefoij30498320493r23 \ @, www, mail protocol=namecheap, \ server=dynamicdns.park-your-domain.com, \ login=foobar.com \ password=faefjawpefoij30498320493r23 \ @, www, mail, smtp
The following steps can be followed to fix this. Note that this patch has only been tested on ddclient 3.8.1 running on RHEL 6. Your mileage may vary with different versions and Linux distributions, and this patch may be applied to future ddclient releases negating the need for these steps.
Stop the ddclient service:
service ddclient stop
Copy your existing ddclient binary to another folder:
mkdir /root/ddclient-patch cp /usr/sbin/ddclient /root/ddclient-patch/
Download and save the ddclient patch:
wget http://thornelabs.net/downloads/ddclient.patch -O /root/ddclient-patch/ddclient.patch
Change to the directory:
Apply the patch:
patch -b -p0 -i ddclient.patch # Successful output patching file ddclient
Copy the newly patched ddclient back:
cp /root/ddclient-patch/ddclient /usr/sbin/
Modify your /etc/ddclient/ddclient.conf file and add the domain name to each hostname like so:
protocol=namecheap, \ server=dynamicdns.park-your-domain.com, \ login=foo.com \ password=faefjawpefoij30498320493r23 \ @.foo.com, www.foo.com, mail.foo.com protocol=namecheap, \ server=dynamicdns.park-your-domain.com, \ login=foobar.com \ password=faefjawpefoij30498320493r23 \ @.foobar.com, www.foobar.com, mail.foobar.com, smtp.foobar.com
Start the ddclient Service Again
Remove the ddclient cache file:
Start the service:
service ddclient start
Monitor /var/log/messages to verify everything is working.