Reason for my question is the following:
I want to host some services on my public server and while they all have normal password protection, I want to ensure the security a tiny bit more. Therefore I want to limit the access to the specific services through ufw and nginx to specific IP addresses. For my homeaddress I can use DYNDNS to get my current IP. However that will not work for my phone, when I’m on the go.
I don’t want to constantly use vpn, as it slows down the speed of the internet connection significantly. Instead I would much prefer to just simply keep my server updated on my phones IP, so I can update the necessary config files through a script and thus allow my phone to access the services, where ever I am.
For iOS there is an app called “Host Monitor”. https://apps.apple.com/app/id989644054
You can connect (ping) hosts (URL, IPs) and can do this even in background.
The frequency can be set to ~hourly, 6 times per day or manual.
So if you set up the server end to fetch the IP of the device with Host Monitor checking; you could make things work the way I believe you want it 😉