DNS Made Easy

DNS Made Easy
DNS Made Easy - http://www.dnsmadeeasy.com/

Dynamic DNS
Dynamic DNS, DDNS, DDNS Hosting and API - http://www.dnsmadeeasy.com/services/dynamic-dns/

Shell Script
Shell Script - dnsmadeeasy-update.sh - http://oldwww.dnsmadeeasy.com/wp-content/uploads/2012/06/dnsmadeeasy-update.tar


 * 1) !/bin/sh
 * 2) dnsmadeeasy-update.sh
 * 3) This script updates Dynamic DNS records on DNE Made Easy's
 * 4) DNS servers.  You must have wget installed for this to work.
 * 5) Author: Jeff Larkin 
 * 6) Last Modified: 08-February-2002
 * 7) This script is released as public domain in hope that it will
 * 8) be useful to others using DNS Made Easy.  It is provided
 * 9) as-is with no warranty implied.  Sending passwords as a part
 * 10) of an HTTP request is inherently insecure.  I take no responsibilty
 * 11) if your password is discovered by use of this script.
 * 1) be useful to others using DNS Made Easy.  It is provided
 * 2) as-is with no warranty implied.  Sending passwords as a part
 * 3) of an HTTP request is inherently insecure.  I take no responsibilty
 * 4) if your password is discovered by use of this script.

DMEUSER=
 * 1) This is the e-mail address that you use to login

DMEPASS=
 * 1) This is your password

DMEID=
 * 1) This is the unique number for the record that you are updating.
 * 2) This number can be obtained by clicking on the DDNS link for the
 * 3) record that you wish to update; the number for the record is listed
 * 4) on the next page.

IPADDR=`ifconfig eth0 | grep inet | awk '{print $2}' | awk -F : '{print $2}'`
 * 1) Obtain current ip address

if wget -q -O /proc/self/fd/1 http://www.dnsmadeeasy.com/servlet/updateip?username=$DMEUSER\&password=$DMEPASS\&id=$DMEID\&ip=$IPADDR | grep success > /dev/null; then logger -t DNS-Made-Easy -s "DNS Record Updated Successfully" else logger -t DNS-Made-Easy -s "Problem updating DNS record." fi


 * 1) David Harris's script for dynodns.net was used as an example
 * 2) in writing this script.

My modifications
/home/kenneth/.admin/dnsmadeeasy.sh:
 * 1) !/bin/bash
 * 2) dnsmadeeasy-update.sh
 * 3) This script updates Dynamic DNS records on DNE Made Easy's
 * 4) DNS servers.  You must have wget installed for this to work.
 * 5) Author: Jeff Larkin 
 * 6) Last Modified: 08-February-2002
 * 7) This script is released as public domain in hope that it will
 * 8) be useful to others using DNS Made Easy.  It is provided
 * 9) as-is with no warranty implied.  Sending passwords as a part
 * 10) of an HTTP request is inherently insecure.  I take no responsibilty
 * 11) if your password is discovered by use of this script.
 * 1) be useful to others using DNS Made Easy.  It is provided
 * 2) as-is with no warranty implied.  Sending passwords as a part
 * 3) of an HTTP request is inherently insecure.  I take no responsibilty
 * 4) if your password is discovered by use of this script.

DMEUSER=
 * 1) This is the e-mail address that you use to login

DMEPASS=
 * 1) This is your password

DMEID=
 * 1) This is the unique number for the record that you are updating.
 * 2) This number can be obtained by clicking on the DDNS link for the
 * 3) record that you wish to update; the number for the record is listed
 * 4) on the next page.

DMEDOMAIN=
 * 1) Domain name for log messages

LAST=/home/kenneth/.admin/.dnsmadeeasy
 * 1) Temporary Save Location
 * 2) LAST=/tmp/dnsmadeeasy


 * 1) echo "Updating $DMEDOMAIN..."

IPADDR=`curl http://ip.oeey.com 2> /dev/null`
 * 1) Obtain current ip address
 * 2) IPADDR=`ifconfig eth0 | grep inet | awk '{print $2}' | awk -F : '{print $2}'`

echo $IPADDR | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$" > /dev/null if [ $? -ne 0 ] ; then # try second time sleep 3 IPADDR=`curl http://ip.oeey.com 2> /dev/null` echo $IPADDR | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$" > /dev/null if [ $? -ne 0 ] ; then logger -t DNS-Made-Easy "Failed to determine public IP Address" exit 1 fi fi
 * 1) Is Valid IP?
 * 1) echo "==$IPADDR=="

if [ -e $LAST ] ; then LASTIP=`cat $LAST` else LASTIP= fi
 * 1) Save last ip to look for changes

echo $IPADDR > $LAST if [ "$IPADDR" == "$LASTIP" ] ; then logger -t DNS-Made-Easy "No change to DNS Record $DMEDOMAIN: $IPADDR" exit 0 else logger -t DNS-Made-Easy "Change to DNS Record $DMEDOMAIN: $IPADDR" fi

if wget -q -O /proc/self/fd/1 https://cp.dnsmadeeasy.com/servlet/updateip?username=$DMEUSER\&password=$DMEPASS\&id=$DMEID\&ip=$IPADDR | grep success > /dev/null; then logger -t DNS-Made-Easy "DNS Record $DMEDOMAIN Updated Successfully to $IPADDR" else # try second time sleep 3 if wget -q -O /proc/self/fd/1 https://cp.dnsmadeeasy.com/servlet/updateip?username=$DMEUSER\&password=$DMEPASS\&id=$DMEID\&ip=$IPADDR | grep success > /dev/null; then logger -t DNS-Made-Easy -s "DNS Record $DMEDOMAIN Updated Successfully to $IPADDR" else logger -t DNS-Made-Easy -s "Problem updating $DMEDOMAIN DNS record to $IPADDR." fi fi


 * 1) David Harris's script for dynodns.net was used as an example
 * 2) in writing this script.

with a cronjob of: @reboot        /home/kenneth/.admin/dnsmadeeasy-update.sh
 * /30 * * * *   /home/kenneth/.admin/dnsmadeeasy-update.sh