Wednesday, 2 January 2013

Rimu Hosting DNS API

Here's the shell script that I'm using on my linux boxes to keep the DNS hosted by Rimu Hosting up to date with any changes to my dynamically allocated IP address from BT.


#!/bin/bash
wget -q -O -  -i rimu-dns-urls.txt  > /dev/null


The idea is to have a text file of URLs each of which updates the DNS for one address.  The list currently looks like this:

https://rimuhosting.com/dns/dyndns.jsp?host=lego.goopot.co.uk&api_key=MY-SECRET-NUMBER&ttl=300
https://rimuhosting.com/dns/dyndns.jsp?host=lego-wiki.goopot.co.uk&api_key=MY-SECRET-NUMBER&ttl=300


I then set up a one-line crontab entry to run this every five minutes:

*/5 * * * * cd ~dave/code/dynadns; ./dns-rimu.sh





No comments: