stecklars / dynamic-dns-netcup-api

A simple dynamic DNS client written in PHP for use with the netcup DNS API.
MIT License
175 stars 55 forks source link

suggestion on how to reduce execution frequency #32

Open chnagy opened 1 month ago

chnagy commented 1 month ago

Just wanted to leave my suggestion to reduce the frequency of the api calls.

Many modern router offer a dyndns feature. I published a dummy GET endpoint in my local network which executes your update.php and entered the host as dyndns server in my router so it triggers the update script only when I receive a new IP from my ISP.

DarkSpir commented 1 month ago

Also a good idea would be to compare the current IP address (as returned by getCurrentPublicIPv[4|6] functions) to the result of a DNS [A|AAAA] record resultion (see dns_get_record function in PHP). If they match, you don't even have to log into the Netcup API because there's nothing for you to do anyway.