MichaIng/DietPi

Feature | dietpi-ddns update only if IP has changed

mkdjns asked for this feature 6 months ago — 3 comments

mkdjns commented 6 months ago

In order to be a good citizen with dynamic DNS updates, it would be great if dietpi-ddns only updated the dynamic DNS service if the IP address has changed since the last update.

MichaIng commented 5 months ago Admin

The problem with this, to check the public IP address (in a generic way) one needs to do a request to another public API. So in every case we need to do an API request, with your suggestion, when the IP changed, two. So I prefer to do a single API request only in every case (to the DDNS provider only), and DDNS providers are most likely prepared to handle those with no changed IP (the IP of the requesting client) with least possible overhead.

If DietPi acts as router, or the router serves a LAN API to get the public IP with a LAN request, then it's a different thing. What we could do is allowing to set an optional command to get the public IP, and when set, store it locally and compare next time, before sending the request.

psi5asp commented 4 months ago

"What we could do is allowing to set an optional command to get the public IP, and when set, store it locally and compare next time, before sending the request."

That is what rinker.sh does for changeip.com (https://www.changeip.com/accounts/index.php?rp=/download/category/4/Linux-or-OSX.html)

It uses this to get the current IP: wget -q -U "rinker.sh wget 1.0" -O $TEMP ip.changeip.com

and compares it to the last (locally stored) IP, and if changed updates the DDNS and stores the new IP locally to compare with next...

Join the discussion!

Sign-in with GitHub to comment