[DDNS] reduce refresh time to 5 min and makes more secure

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3  Next
Author Message
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Sat Dec 09, 2023 12:53    Post subject: Reply with quote
Code:
service ddns stop
sed -i 's/forced-update = 864000/forced-update = 600/g' /tmp/ddns/inadyn.conf
inadyn --cache-dir=/tmp/ddns -e ddns_success --exec-mode=compat -f /tmp/ddns/inadyn.conf -P /var/run/inadyn.pid -l notice -C


and again, don't do it!

This is nonsense, you are forcing an update every 5 minutes even if no udpate is required.

Some DDNS providers are known for not liking frequent updates and will suspend your account.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP


Last edited by ho1Aetoo on Sat Dec 09, 2023 13:02; edited 1 time in total
Sponsor
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Sat Dec 09, 2023 12:57    Post subject: Reply with quote
Restarting the router completely does force the DDNS update but stopping and starting the service does not.

I only use the router for DDNS (I don't use it as my main router, or to broadcast wifi, or anything else) so I can configure it or reboot it as I need to. I have configured an autoreboot every 3600 seconds. So that when 1 hour passes it restarts itself.

In the restart as I say if you force the update of the IP so solved. :_)

Maybe it is not the most elegant solution but it does the job.



thanks
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Sat Dec 09, 2023 13:06    Post subject: Reply with quote
Try:
stopservice ddns
startservice ddns

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Sat Dec 09, 2023 13:12    Post subject: Reply with quote
Code:
stopservice ddns
startservice ddns

nothing, it does not force the IP update either. It does not work either.

I have only found the solution to completely reboot the router.
In the restart as I say if you force the update of the IP so solved. :_)
Maybe it is not the most elegant solution but it does the job.[/code]
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Sat Dec 09, 2023 13:19    Post subject: Reply with quote
You have to delete the cache file

Code:
rm /tmp/ddns/*.cache
service ddns restart


if inadyn does not know which IP was last updated then an update is forced.

you can save yourself the trouble of restarting, the update is also forced with the next regular update (every 5 minutes)

Or see my solution above

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Sat Dec 09, 2023 14:20    Post subject: Reply with quote
Code:
rm /tmp/ddns/*.cache
service ddns restart


and

Code:
stopservice ddns
rm /tmp/ddns/*.cache
startservice ddns


does not work either. For now the only solution is a reboot.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Sat Dec 09, 2023 14:35    Post subject: Reply with quote
Of course it works, I have tested it myself.

You just have to make sure that the correct file is deleted

Code:
root@DD-WRT:/tmp/ddns# ls -la
drwx------    2 root     root             0 Dec  9 15:43 .
drwxrwxrwx   17 root     root             0 Dec  9 09:56 ..
-rw-r--r--    1 root     root            13 Dec  9 15:43 xyz.de.cache
-rw-r--r--    1 root     root           270 Dec  9 15:43 ddns.log
-rw-------    1 root     root           301 Dec  9 15:42 inadyn.conf


Code:
root@DD-WRT:/tmp/ddns# rm /tmp/ddns/*.cache


Code:
root@DD-WRT:/tmp/ddns# service ddns restart
[inadyn] : dynamic dns daemon successfully stopped
[ddns] : successfully started


Code:
root@DD-WRT:/tmp/ddns# cat ddns.log
In-a-dyn version 2.11.0 -- Dynamic DNS update client.


Code:
root@DD-WRT:/tmp/ddns# cat ddns.log
In-a-dyn version 2.11.0 -- Dynamic DNS update client.
Update forced for alias xyz.de, new IP# 11.22.33.44.55.66
Updating IPv4 cache for xyz.de


If it doesn't work, you're doing something wrong - so don't report nonsense


Without deleting the cache file, nothing happens at all

Code:
root@DD-WRT:/tmp/ddns# service ddns restart
[inadyn] : dynamic dns daemon successfully stopped
[ddns] : successfully started


Code:
root@DD-WRT:/tmp/ddns# cat ddns.log
In-a-dyn version 2.11.0 -- Dynamic DNS update client.
root@DD-WRT:/tmp/ddns#


Code:
root@DD-WRT:/tmp/ddns# service ddns restart
[inadyn] : dynamic dns daemon successfully stopped
[ddns] : successfully started


Code:
root@DD-WRT:/tmp/ddns# cat ddns.log
In-a-dyn version 2.11.0 -- Dynamic DNS update client.
root@DD-WRT:/tmp/ddns#

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Sat Dec 09, 2023 16:46    Post subject: Reply with quote
it doesn't work for me, I have repeated your steps and as you can see in the cat ddns.log it never performs the update.


Code:
0;root@DD-WRTDDNS: ~root@DD-WRTDDNS:~# cd /tmp/ddns/


Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# ls -la
drwxr--r--    2 root     root             0 Jan  1  1970 .
drwxrwxrwx   13 root     root             0 Dec  9 17:26 ..
-rw-r--r--    1 root     root           181 Dec  9 17:22 ddns.log
-rw-r--r--    1 root     root            13 Dec  9 17:22 default@duckdns.org-manolo.cache
-rw-r--r--    1 root     root           180 Jan  1  1970 inadyn.conf


Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# rm /tmp/ddns/*.cache


Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# ls -la
drwxr--r--    2 root     root             0 Dec  9 17:37 .
drwxrwxrwx   13 root     root             0 Dec  9 17:26 ..
-rw-r--r--    1 root     root           181 Dec  9 17:22 ddns.log
-rw-r--r--    1 root     root           180 Jan  1  1970 inadyn.conf


here you can check that the *.cache file has been properly deleted.

Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# service ddns restart
[inadyn] : dynamic dns daemon successfully stopped
[ddns] : successfully started


Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.


as you can see the file, *.cache has created itself again.

Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# ls -la
drwxr--r--    2 root     root             0 Dec  9 17:39 .
drwxrwxrwx   13 root     root             0 Dec  9 17:26 ..
-rw-r--r--    1 root     root            58 Dec  9 17:39 ddns.log
-rw-r--r--    1 root     root            13 Dec  9 17:39 default@duckdns.org-manolo.cache
-rw-r--r--    1 root     root           180 Dec  9 17:39 inadyn.conf


but still does not run the update

Code:
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.
0;root@DD-WRTDDNS: /tmp/ddnsroot@DD-WRTDDNS:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0-dev -- Dynamic DNS update client.


so I reaffirm that the only way the update works for me is by restarting the router.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Sat Dec 09, 2023 18:29    Post subject: Reply with quote
So I updated the firmware especially because of you and it still works for me.

Code:
root@DD-WRT:/tmp/ddns# rm /tmp/ddns/*.cache


Code:
root@DD-WRT:/tmp/ddns# service ddns restart
[inadyn] : dynamic dns daemon successfully stopped
[ddns] : successfully started


Code:
root@DD-WRT:/tmp/ddns# cat ddns.log
In-a-dyn version 2.12.0 -- Dynamic DNS update client.
Update forced for alias xyz.de, new IP# 11.22.33.44
Updating IPv4 cache for xyz.de


So I have no idea what's wrong with your router.
But firstly, your command line looks broken and secondly, In-a-dyn version 2.12.0-dev is displayed

No idea what build the dev version had

and think about what the difference is between a router restart and a service restart

When you restart the router, the log and cache files are not available. Rolling Eyes

By the way, the developer himself writes that this works

https://github.com/troglobit/inadyn/issues/177#issuecomment-333742618

Quote:
Or set up an inotify/dnotify/cronjob script to remove the cache file(s), for a more granular per-provider set up.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Sun Dec 10, 2023 21:41    Post subject: Reply with quote
I see... I'll try with the same version as yours... tell me exactly what version of dd-wrt you have and I'll check with that version too.

thanks
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Mon Dec 11, 2023 16:56    Post subject: Reply with quote
https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/12-07-2023-r54475/

I had last tested r54475 on my r7800

You can try it - I don't have much hope that it will work but who knows

and yes, the cleanest way is to stop the process before deleting the cache file - but you've already tried that too

Code:
service ddns stop
rm /tmp/ddns/*.cache
service ddns start


For me, it also works the hard way.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Mon Dec 11, 2023 20:41    Post subject: Reply with quote
Now i have Firmware: DD-WRT v3.0-r53469 std (09/08/23) i will check your version r54475

thanks
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Mon Dec 11, 2023 21:22    Post subject: Reply with quote
I have upgraded to the firmware version: DD-WRT v3.0-r54475 std (12/07/23) and nothing changes. It still doesn't update the IP by stopping, clearing cache and booting.

Everything is the same as before, the only way to force the ip update is to reboot.


ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3006
Location: Germany

PostPosted: Mon Dec 11, 2023 21:46    Post subject: Reply with quote
Code:
killall -SIGUSR1 inadyn

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
spyfly
DD-WRT User


Joined: 26 Jun 2010
Posts: 92

PostPosted: Mon Dec 11, 2023 23:40    Post subject: Reply with quote
This command works perfect!!! I can update the DDNS IP without rebooting the whole router.

Code:
killall -SIGUSR1 inadyn


SOLUTION

So it can be configured as a cron job and run itself every 60 minutes.

Code:
00 * * * * root killall -SIGUSR1 inadyn


thank you very much for all the help
Goto page Previous  1, 2, 3  Next Display posts from previous:    Page 2 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum