NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

bnichols's avatar
Apr 25, 2009

DNS-O-Matic add-on

Am just trying Super Poussin's new DNS-O-Matic add-on. Installed, disabled, modified the dnsomatic file and restarted the service. There doesn't seem to be a way to confirm that it's working. If I log into my account on the dnsomatic website, it just sits there saying "Waiting for first update" for both my dyndns and opendns account. Any way to confirm its proper installation and usage?
Thanks!
PS I forgot to mention I installed the 1.1 version that was updated a few hours ago (from 1.0 early this morning).

103 Replies

Replies have been turned off for this discussion
  • Dang, I was hoping there would be a solution posted.

    I'm using the latest version of sparc DNS-O-Matic add-on, which calls itself v.2.0 (7-13-09).

    I've put in all the information as requested (username and password), after first disabling the add-on of course.
    Found the dnsomatic file in the addons-scripts share that appeared after restarting the ReadyNAS, and I edited it with notepad (Windows).
    I've re-enabled the plugin, and the ReadyNAS log reflects that it's started up, but I left it overnight and there's no update in the log or on the DNS-O-Matic site.

    Is this add-on still being supported? Or should I try to figure out a different solution?

    Thanks,
    Seth
  • I've tried out DDClient, which has a dns-o-matic example on this page:
    http://www.readynas.com/forum/viewtopic.php?f=47&t=62337

    This has successfully updated the IP address properly to DNS-O-Matic. It's only done it once, though, so far -- not sure if it will keep updating or if this is something I'll have to do it manually. And the documentation leaves much to be desired.

    Sigh.
  • I didn't continue using DDClient, it seemed too much of a pain to configure.

    Instead, I went back to DnsOMatic, and debugged the script (the "dnsomatic" file that's in [ReadyNAS]/addons-scripts/DnsOMatic).

    NOTE: I DISCOVERED THAT MY PROBLEMS STEMMED FROM THE FACT THAT MY PASSWORD HAD SYMBOLS IN IT (specifically "!") WHICH BROKE THE SCRIPT. I'D SUGGEST CHANGING YOUR PASSWORD TO JUST LETTERS/NUMBERS.

    While I was in there, I made some of the stuff into variables that can be easily edited to allow the script to update with different services. I currently use it to update directly to no-ip.com's service, so I don't have to keep track of two accounts. I also removed the excess code and commented the rest so it should be easier to understand. And I made it so the log file will appear in the same folder as the script so the casual user can see it.

    Here's the modified script that should work properly with DnsOMatic's service:

    #!/bin/bash

    HOSTNAME="all.dnsomatic.com"
    USER=xxxxxx
    PASS=password

    DYNUPDHOST="updates.dnsomatic.com"
    MYIPHOST="myip.dnsomatic.com"
    ADDHOSTARGS="&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"

    TMPFILE="/addons-scripts/DnsOMatic/oldip.DNS-O-Matic"
    LOGFILE="/addons-scripts/DnsOMatic/DNS-O-Matic.log"

    DATENOW=$(date)
    TIME=$(date +%R)
    DOW=$(date +%w)

    # Turn debug to "Yes" if you want verbose info to be logged
    DEBUG="NO"

    # If password hasn't changed from default, this hasn't been updated -- exit out now
    if [ $PASS = "password" ]; then
    exit 0
    fi

    # Find out my external IP via "my IP" service
    IP=$(/usr/local/bin/curl -s http://${MYIPHOST})

    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": Running" $DOW $TIME $IP>> $LOGFILE
    fi

    if [[ -z $IP ]]; then
    # NO IP discovered, can't update
    echo $DATENOW ": NO Internet IP : exiting" >> $LOGFILE
    exit 0
    fi

    # If the "oldip" file exists, pull OLDIP from it
    if [ -r "$TMPFILE" ]; then
    OLDIP=`cat $TMPFILE`

    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": found:" $IP " cached IP:" $OLDIP >> $LOGFILE
    fi

    # If old IP cache doesn't exist (see above), create it for use next time
    else
    touch $TMPFILE
    fi

    # IF it's Monday at 1AM, force an update by blanking OLDIP
    if [ $DOW = "1" ];then
    if [ $TIME = "01:00" ]; then
    echo $DATENOW ": Resetting IP" $TIME >> $LOGFILE
    OLDIP=""
    fi
    fi

    # IF cached IP and current IP match, no change, quit
    if [ "$OLDIP" = "$IP" ]; then
    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": Current IP " $IP " and cached IP " $OLDIP " match, NO UPDATE" >> $LOGFILE
    fi
    exit 0

    # Otherwise, update to current IP
    else
    echo $DATENOW ": Current IP" $IP "and cached IP" $OLDIP " MISMATCH, requesting IP update" >> $LOGFILE

    RETURN=$(/usr/local/bin/curl -k -s http://${USER}:${PASS}@${DYNUPDHOST}/nic/update?hostname=${HOSTNAME}&myip=${IP}${ADDHOSTARGS})

    echo $DATENOW ": Return message of $DYNUPDHOST : " $RETURN >> $LOGFILE
    echo $RETURN | grep "good|nochg" > /dev/null 2>&1

    # IF the update was a success (got a "good" or "nochg" response), put the new ip address into the oldip tempfile
    if [ "$?" -eq "0" ]; then
    echo $IP > $TMPFILE
    echo $DATENOW ": Update successful. New IP" $IP " written to cache " $TMPFILE >> $LOGFILE
    else
    # Otherwise, blank the tempfile to force another try next time
    echo "" > $TMPFILE
    echo $DATENOW ": IP cache cleared " $TMPFILE >> $LOGFILE
    fi
    fi


    ---

    And here's the same script, but the first few variables are adjusted to work with no-ip. Basically, we're hijacking this plugin to serve our own nefarious ends. 8)

    Note the changes to HOSTNAME (insert your no-ip hostname here), DYNUPDHOST and MYIPHOST (using no-ip's service), and ADDHOSTARGS (I removed the stuff that I didn't need for no-ip updates).

    #!/bin/bash

    HOSTNAME="XXXXXXXX.XXXXXXXX.XXX"
    USER=xxxxxx
    PASS=password

    DYNUPDHOST="dynupdate.no-ip.com"
    MYIPHOST="ip1.dynupdate.no-ip.com"
    ADDHOSTARGS=""

    TMPFILE="/addons-scripts/DnsOMatic/oldip.DNS-O-Matic"
    LOGFILE="/addons-scripts/DnsOMatic/DNS-O-Matic.log"

    DATENOW=$(date)
    TIME=$(date +%R)
    DOW=$(date +%w)

    # Turn debug to "Yes" if you want verbose info to be logged
    DEBUG="NO"

    # If password hasn't changed from default, this hasn't been updated -- exit out now
    if [ $PASS = "password" ]; then
    exit 0
    fi

    # Find out my external IP via "my IP" service
    IP=$(/usr/local/bin/curl -s http://${MYIPHOST})

    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": Running" $DOW $TIME $IP>> $LOGFILE
    fi

    if [[ -z $IP ]]; then
    # NO IP discovered, can't update
    echo $DATENOW ": NO Internet IP : exiting" >> $LOGFILE
    exit 0
    fi

    # If the "oldip" file exists, pull OLDIP from it
    if [ -r "$TMPFILE" ]; then
    OLDIP=`cat $TMPFILE`

    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": found:" $IP " cached IP:" $OLDIP >> $LOGFILE
    fi

    # If old IP cache doesn't exist (see above), create it for use next time
    else
    touch $TMPFILE
    fi

    # IF it's Monday at 1AM, force an update by blanking OLDIP
    if [ $DOW = "1" ];then
    if [ $TIME = "01:00" ]; then
    echo $DATENOW ": Resetting IP" $TIME >> $LOGFILE
    OLDIP=""
    fi
    fi

    # IF cached IP and current IP match, no change, quit
    if [ "$OLDIP" = "$IP" ]; then
    if [ $DEBUG = "Yes" ]; then
    echo $DATENOW ": Current IP " $IP " and cached IP " $OLDIP " match, NO UPDATE" >> $LOGFILE
    fi
    exit 0

    # Otherwise, update to current IP
    else
    echo $DATENOW ": Current IP" $IP "and cached IP" $OLDIP " MISMATCH, requesting IP update" >> $LOGFILE

    RETURN=$(/usr/local/bin/curl -k -s https://${USER}:${PASS}@${DYNUPDHOST}/nic/update?hostname=${HOSTNAME}&myip=${IP}${ADDHOSTARGS})

    echo $DATENOW ": Return message of $DYNUPDHOST : " $RETURN >> $LOGFILE
    echo $RETURN | grep "good|nochg" > /dev/null 2>&1

    # IF the update was a success (got a "good" or "nochg" response), put the new ip address into the oldip tempfile
    if [ "$?" -eq "0" ]; then
    echo $IP > $TMPFILE
    echo $DATENOW ": Update successful. New IP" $IP " written to cache " $TMPFILE >> $LOGFILE
    else
    # Otherwise, blank the tempfile to force another try next time
    echo "" > $TMPFILE
    echo $DATENOW ": IP cache cleared " $TMPFILE >> $LOGFILE
    fi
    fi


    SO... in theory, you can replace the code in your dnsomatic script file with this code and be good to go. Don't forget to disable the add-on before editing, and re-enable afterward.

    I've tried both versions of the scripts above, and they do work.

    Have fun!
    Seth

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More