As posted, the problem looks too wide.
As I understand, you have two different problems:
- Generate a method to avoid the problem in future cases.
- Access to the servers that currently have the problem, to implement solution 1.
For problem #1,
instead of getting a way to know the new IP, you could have the servers recover the old IP to a fixed value.
You could set a crontab task that checks the current IP, and whenever it deviates from a set value, it changes the IP back to the target.
You will of course have time windows of "network-blindness", depending on the frequency set in crontab.
Alternatively, a crontab task could broadcast/send email/etc. the new IP.
The right mechanisms depend very much on what are you willing to operate, how are you accessing the servers.
All this seems a workaround.
If correctly configured, they should not "forget the PC IP address".
This is the point to fix, I guess.
If you could give more information on the current configuration, that will narrow the problem.
For problem #2,
if that is your target please mention it.
I have a "similar" problem.
A server that I am accessing remotely changes IP once in a while, since it is assigned by DHCP.
Whenever I have problems ssh
ing to the server, I execute a small script that, by a combination of ping
and ssh
(within a loop of IPs), and checking on the response, can get the current IP.
Depending on many aspects of your network configuration this may work for you or not.