Skip to content

Update script DNS-O-Matic

2007 December 18
by Philippe Delodder

This script I wrote to
automate the update of my dyndns with the DNS-O-Matic service. Now I
have only to execute one script in order to update two dyndns
services. The DNS-O-Matic a service of openDNS. What is DNS-O-Matic? :

DNS-O-Matic provides you a free and easy way to announce
your dynamic IP changes to multiple services with a single update.
Using DNS-O-Matic allows you to pick and choose what Dynamic DNS
services you want to notify, all from one easy to use interface.

I have use this script in combination with cron. You can run it as
root or as normal user, just at the line below on the appropret crontab
you want and put the correct absolute path with the right filename.

*/5 * * * * /path/to/update.sh

This scripts shown here below, you can also download it here

#!/bin/bash#Script created by lodder#   Email: lodder at delodder . beHOSTNAME="example.org"USER="username"PASS="password"IP=$(curl -s http://myip.dk/ | egrep -m1 -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}')if [ -r "/tmp/oldip.txt" ]; thenOLDIP=`cat /tmp/oldip.txt`if [ "$OLDIP" = "$IP" ]; thenexit 0elseecho $IP > /tmp/oldip.txtRETURN=$(curl -s https://${USER}:${PASS}@updates.dnsomatic.com/nic/update?hostname=${HOSTNAME}&myip=$IP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG)echo "Return message of DNS-O-Matic : " $RETURNfifi

More information about the DNS-O-Matic service can be found here

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Bad Behavior has blocked 116 access attempts in the last 7 days.