What's new

Updating Dynamic Dns only if changed?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

nitro001

Regular Contributor
Hello,
I am using a AC66R router with the latest Merlin 387.55 firmware.
Is it possible to only send updates to a DDNS service if the IP of the WAN has changed?
I am using DNS-O-Matic and since I have moved every once in a while my cable modem decided to go flaky and looses its connection and has to renegotiate the connection. Sometimes this takes a while, but it works, and I believe it is an issue with Time Warner on their end with signal strength; however, every time this happens, the router sees the loss of the IP and the fact it gets a new one; but then sends the request right on to DNS-O-Matic, where I receive a nice email back:

Below is the most recent response from your DNSexit service registered at DNS-O-Matic.


DNSexit response for '****.linkpc.net':
--------------------
HTTP/1.1 200 OK
4=IP not changed. To save our system resources, please don't post updates unless the IP got changed.
--------------------

- The DNS-O-Matic Team


so DNS-O-Matic knows that the IP had not changed, and this is the only way as of now I know my modem has rebooted itself when I am away; but I don't want to get removed from DNS-O-Matic or any other DDNS service for updating or reporting too frequently.

What I am getting at, is there a way that the router to remember the IP from the last request and only send if it had changed from the last one? It seems Time Warner is re-assigning me the same IP address over and over.

Thanks.
 
Hello,
I am using a AC66R router with the latest Merlin 387.55 firmware.
Is it possible to only send updates to a DDNS service if the IP of the WAN has changed?
I am using DNS-O-Matic and since I have moved every once in a while my cable modem decided to go flaky and looses its connection and has to renegotiate the connection. Sometimes this takes a while, but it works, and I believe it is an issue with Time Warner on their end with signal strength; however, every time this happens, the router sees the loss of the IP and the fact it gets a new one; but then sends the request right on to DNS-O-Matic, where I receive a nice email back:

Below is the most recent response from your DNSexit service registered at DNS-O-Matic.


DNSexit response for '****.linkpc.net':
--------------------
HTTP/1.1 200 OK
4=IP not changed. To save our system resources, please don't post updates unless the IP got changed.
--------------------

- The DNS-O-Matic Team


so DNS-O-Matic knows that the IP had not changed, and this is the only way as of now I know my modem has rebooted itself when I am away; but I don't want to get removed from DNS-O-Matic or any other DDNS service for updating or reporting too frequently.

What I am getting at, is there a way that the router to remember the IP from the last request and only send if it had changed from the last one? It seems Time Warner is re-assigning me the same IP address over and over.

Thanks.

http://www.snbforums.com/threads/ddns-duckdns-org.16649/#post-169499
 
But isn't that for a custom DDNS entry and not the Built-in DNS-O-MATIC entry?
Using that I would have to set the Custom entry, create the script it is asking for, then find out what the calling URL to DNS-O-MATIC is with the correct URL items, right?
 
I think I finally got it:
#!/bin/sh
# Update the following variables:
USERNAME=dnsomatic_username
PASSWORD=dnsomatic_password
HOSTNAME=all.dnsomatic.com

MYROUTER=$(nvram get computer_name)
MY_WANIPADDR=$(nvram get wan0_ipaddr)
ROUTERFILE=/tmp/DDNS_IPADDR.txt
TEMPFILE=/tmp/DDNS_IPADDR.tmp
touch $ROUTERFILE
MY_WANIPADDRX=$(cat $ROUTERFILE)

logger -s -t "($(basename $0))" $$ Previous WAN IP $MY_WANIPADDRX
logger -s -t "($(basename $0))" $$ Current WAN IP $MY_WANIPADDR
echo "" >$TEMPFILE

# Check if I/P address has changed
if [ "$MY_WANIPADDR" = "$MY_WANIPADDRX" ]; then
echo "My "$ISP" t'Tinterweb IP address is: "$MY_WANIPADDR >>$TEMPFILE
echo "" >>$TEMPFILE
logger -s -t "($(basename $0))" $$ WAN IP unchanged
/sbin/ddns_custom_updated 1
else
echo "I just got connected t'Tinterweb." >>$TEMPFILE
echo "" >>$TEMPFILE
echo "My new "$ISP" IP address is: >"$MY_WANIPADDR"< was >"$MY_WANIPADDRX"<" >>$TEMPFILE
echo "" >>$TEMPFILE
logger -s -t "($(basename $0))" $$ WAN IP changed!!!

# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent "https://$USERNAME:$PASSWORD@updates...ME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" > /dev/null
echo "https://$USERNAME:$PASSWORD@updates...ME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" >> $TEMPFILE
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi

# Save the current WAN I/P address
echo "$MY_WANIPADDR" > $ROUTERFILE
fi
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top