What's new

Dynamic DNS and wan-start?

  • 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!

EvgeniX

Occasional Visitor
Hi,

since AiCloud does not work with dnsomatic I'm trying to update http://freedns.afraid.org/ with new IP manually in wan-start:

Code:
#!/bin/sh

wget -O- --read-timeout=0.0 --waitretry=5 --tries=400 --background http://freedns.afraid.org/dynamic/update.php?VVhTVF >/dev/null

but it does not work... any ideas why? :confused:

I did this too - chmod a+rx /jffs/scripts/*

pleas help.... :(
 
Hi,

since AiCloud does not work with dnsomatic I'm trying to update http://freedns.afraid.org/ with new IP manually in wan-start:

Code:
#!/bin/sh

wget -O- --read-timeout=0.0 --waitretry=5 --tries=400 --background http://freedns.afraid.org/dynamic/update.php?VVhTVF >/dev/null

but it does not work... any ideas why? :confused:

I did this too - chmod a+rx /jffs/scripts/*

pleas help.... :(


Hello,
I update dnsomatic using /usr/sbin/ez-ipupdate called with the following configuration file:

service-type=dnsomatic
user=youruser:yourpassword
interface=ppp0
host=yourhost

Pleasce change the configuration file with your right values

I call ez-ipupdate in wan-start but i also call it in a cru command because I noticed that sometimes the IP was not updated due to a quick modem disconnect and reconnect while the router was in "idle"


BR
Ocram
 
Last edited:
THX!

ppp0 did not work on my AC66 but eth0 works...

will try to use it

also what is "cru command" ??
 
THX!

ppp0 did not work on my AC66 but eth0 works...

will try to use it

also what is "cru command" ??

Hello
I am pleased that I was able to help you.
Ok ppp0 worked for me because i use a ppp connection to the public network, probably you use a cable connection

cru is the "equivalent of crontab" in asuswrt-merlin , please type cru in a ssh session to get help.
It allows you to run scheduled jobs.

==================
admin@RT-N66U:/tmp# cru

Cron Utility
add: cru a <unique id> <"min hour day month week command">
delete: cru d <unique id>
list: cru l
=================

BR
Ocram
 
Hello,
I update dnsomatic using /usr/sbin/ez-ipupdate called with the following configuration file:

service-type=dnsomatic
user=youruser:yourpassword
interface=ppp0
host=yourhost

Pleasce change the configuration file with your right values

I call ez-ipupdate in wan-start but i also call it in a cru command because I noticed that sometimes the IP was not updated due to a quick modem disconnect and reconnect while the router was in "idle"


BR
Ocram

Hello Ocram,

I am very interested in howto use ez-ipupdate with wan-start.
I assume I just have to add the line /usr/sbin/ez-ipupdate within wan-start?
(Wan-start does already contain a script which send a mail when IP has changed).

I am a little bit confused with the configuration file.
ez-ipupdate --help tells me to use -c <file>
Should I just make a file (config) within /usr/sbin/ and then call ez-ipupdate -c config ?

Tx.

Lennard
 
OK, Since dyndns.org is now exit for free users, a little contribution from my side in howto automatically update dnsomatic to prevent an account loss.

Ofcourse you need a dnsomatic account (www.dnsomatic.com) and a DDNS account (for instance noip.me). Make sure dnsomatic works.

Router setup:
Use putty.exe and logon to the router. (enable SSH in router -Administration -System)

I created a file called ez-ipupdate.conf in /jffs with content:

Code:
service-type=dnsomatic
user=[yourusername]:[yourpassword]
interface=eth0
host=all.dnsomatic.com

I then created a file called dnsomatic.sh in /jffs/scripts with content:

Code:
#!/bin/sh

# Called by init-start. Periodically updating DNS-O-Matic
# L. de Bles, 2014

/usr/sbin/ez-ipupdate -c /jffs/ez-ipupdate.conf

Another file called init-start in /jffs/scripts with content:

Code:
#!/bin/sh

# Periodically updating DNS-O-Matic.
# L. de Bles, 2014
#
# * * * * *  command to execute
# - - - - -
# ¦ ¦ ¦ ¦ ¦
# ¦ ¦ ¦ ¦ ¦
# ¦ ¦ ¦ ¦ +----- day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use
# ¦ ¦ ¦ +---------- month (1 - 12)
# ¦ ¦ +--------------- day of month (1 - 31)
# ¦ +-------------------- hour (0 - 23)
# +------------------------- min (0 - 59)
#
# ------------------------------------------------------------------------------

cru a DNS-O-Matic "00 18 * * 0 /jffs/scripts/dnsomatic.sh"

Don't forget to make files executable:
chmod a+rx /jffs/scripts/* .

Just to check: run /jffs/scripts/init-start.
Check if updateschedule is set (crontab -l)

After rebooting dnsomatic is updated every sunday at 1800.

Just for fun: If you would like to auto update dnsomatic every time your WAN ip is changed, create or edit the file /jffs/scripts/wan-start

Code:
#!/bin/sh

# Auto updating DNS-O-Matic at WAN IP change.
# L. de Bles, 2014

sleep 5

/usr/sbin/ez-ipupdate -c /jffs/ez-ipupdate.conf

Make sure to make file executable (chmod a+rx /jffs/scripts/*)

Reboot your router to make changes effective.

Tip:
Edit a file with: vi /jffs/[filename]
Insert tekst by hitting "i" (insert)
Exit inserting by using [ESC]
Save file with: :wq
Exit file without saving: :q!
 
Last edited:
I'm trying to update http://freedns.afraid.org/ with new IP manually in wan-start:

Code:
#!/bin/sh

wget -O- --read-timeout=0.0 --waitretry=5 --tries=400 --background http://freedns.afraid.org/dynamic/update.php?VVhTVF >/dev/null

but it does not work... any ideas why? :confused:

I did this too - chmod a+rx /jffs/scripts/*

pleas help.... :(
I just faced the same issue as freedns.afraid.org is not supported by Asuswrt-Merlin by default. But you can easily update it just by getting rid of some of the parameters which are not supported by busybox version of wget:

/jffs/scripts/wan-start:

Code:
#!/bin/sh
sleep 5
wget -q -T 1 -s [url]http://freedns.afraid.org/dynamic/update.php?VVhTVFblablablabla[/url] >& /dev/null
 
Last edited:
A better version of the script to have status of Afraid DynDNS updates in the syslog:

/jffs/scripts/wan-start

Code:
#!/bin/sh

sleep 5

WGET_ERROR=$(wget -q -T 1 -O - http://freedns.afraid.org/dynamic/update.php?VVhTVFblablablabla | grep -v -i "has not changed" | grep -i error)

if [ -n "$WGET_ERROR" ] ; then
        logger "****** dyndns-afraid-update ******: DynDNS could not be updated: $WGET_ERROR"
else
        logger "****** dyndns-afraid-update ******: DynDNS update OK"
fi
 
Last edited:
OK, Since dyndns.org is now exit for free users, a little contribution from my side in howto automatically update dnsomatic to prevent an account loss.

Ofcourse you need a dnsomatic account (www.dnsomatic.com) and a DDNS account (for instance noip.me). Make sure dnsomatic works.

Router setup:
Use putty.exe and logon to the router. (enable SSH in router -Administration -System)

I created a file called ez-ipupdate.conf in /jffs with content:

Code:
service-type=dnsomatic
user=[yourusername]:[yourpassword]
interface=eth0
host=all.dnsomatic.com

I then created a file called dnsomatic.sh in /jffs/scripts with content:

Code:
#!/bin/sh

# Called by init-start. Periodically updating DNS-O-Matic
# L. de Bles, 2014

/usr/sbin/ez-ipupdate -c /jffs/ez-ipupdate.conf

Another file called init-start in /jffs/scripts with content:

Code:
#!/bin/sh

# Periodically updating DNS-O-Matic.
# L. de Bles, 2014
#
# * * * * *  command to execute
# - - - - -
# ¦ ¦ ¦ ¦ ¦
# ¦ ¦ ¦ ¦ ¦
# ¦ ¦ ¦ ¦ +----- day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use
# ¦ ¦ ¦ +---------- month (1 - 12)
# ¦ ¦ +--------------- day of month (1 - 31)
# ¦ +-------------------- hour (0 - 23)
# +------------------------- min (0 - 59)
#
# ------------------------------------------------------------------------------

cru a DNS-O-Matic "00 18 * * 0 /jffs/scripts/dnsomatic.sh"

Don't forget to make files executable:
chmod a+rx /jffs/scripts/* .

Just to check: run /jffs/scripts/init-start.
Check if updateschedule is set (crontab -l)

After rebooting dnsomatic is updated every sunday at 1800.

Just for fun: If you would like to auto update dnsomatic every time your WAN ip is changed, create or edit the file /jffs/scripts/wan-start

Code:
#!/bin/sh

# Auto updating DNS-O-Matic at WAN IP change.
# L. de Bles, 2014

sleep 5

/usr/sbin/ez-ipupdate -c /jffs/ez-ipupdate.conf

Make sure to make file executable (chmod a+rx /jffs/scripts/*)

Reboot your router to make changes effective.

Tip:
Edit a file with: vi /jffs/[filename]
Insert tekst by hitting "i" (insert)
Exit inserting by using [ESC]
Save file with: :wq
Exit file without saving: :q!

is there away to make this technique not conflict with Asus ddns from starting up?
 
Last edited:
is there away to make this technique not conflict with Asus ddns from starting up?

this is what the log looks like while running this script.

issue with asusddnsupdate1.jpg
 
Hi,

since AiCloud does not work with dnsomatic I'm trying to update http://freedns.afraid.org/ with new IP manually in wan-start:

Code:
#!/bin/sh

wget -O- --read-timeout=0.0 --waitretry=5 --tries=400 --background http://freedns.afraid.org/dynamic/update.php?VVhTVF >/dev/null

but it does not work... any ideas why? :confused:

I did this too - chmod a+rx /jffs/scripts/*

pleas help.... :(

Try this in "ddns-start"
Code:
#!/bin/sh

update=">key<"

/usr/sbin/curl --retry 3 -s -S "https://freedns.afraid.org/dynamic/update.php?$update" >/dev/null 2>&1 &


    if [ $? -eq 0 ]; then

     /sbin/ddns_custom_updated 1

    else

     /sbin/ddns_custom_updated 0

fi
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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