I’ve got a Mac at work, behind a firewall, with an IP address and hostname assigned via DHCP.
If I have the hostname and/or IP address, I can use ssh or a vnc client to access the machine if I activate my workplace vpn. This works fine; no additional ports need to be opened.
However, because of DHCP leases, those are liable to change at least occasionally. Is there any way to track them?
The computer is connected to various cloud services but none of them seem to know the correct IP address. (And it’s not clear that they would have the correct address for getting through the firewall via vpn).
- iCloud doesn’t report an IP address anywhere obvious. Similar for Dropbox.
- I thought that the Edovia Screens Connect client might help, but it doesn’t seem to have the information.
- Backblaze reports an IP address associated with the computer but it does not seem to be the right one (perhaps because of the firewall?).
I have also considered a ddns provider, but I’m not sure I want the required client software running on my device. macOS supports secure remote ddns via “RFC 3007” but I’m not sure if any (free?) ddns providers offer this.
My current idea, not yet implemented is:
- create a script which writes the output of
host $(hostname)to a file. (Nb. this is the correct address for remote connections via the vpn.) - Put that file at a location that is shared via iCloud Drive
- Run the script periodically via
launchd.
This should work, but it will still require monitoring that text file by hand.
Any better ideas?