I want to do communication between a tethering device and and a downstream device.
Each time I restart tethering ( / or the phone, its always both at the same time), the gateway IP from perspective of the downstream is a different one inside of the 192.168.0.0/16 space each time.
The software I use needs at least one side to listen and one side to connect.
But with random IPs neither downstream nor phone is stable.
Is there any way to get this automatically?
Is there a locally available DNS-Name for the gateway maybe?
Without modifying the application and thereby maintaining a fork I can only input IPs or DNS Names.
A very weird solution would be to use some kind of DynDNS scheme for that. Which is propably easier with the downstream device as initiator. But then I need to involve external hosts for DNS.
Downstream has name -> Phone doesn't know it in its dns cache. -> Roundtrip to outside dns and back.
Phone has name -> Unknown if it exposes the tethering gateway IP under that name and if I can even manipulate the phone resolver on unmodified GOS. -> So likely also roundtrip through external DNS.
What is a good way to solve this?