Sometimes I have to access my work box from a remote location, like my home.
The IP address on my work box is dynamic, which means that it can change without notice.
This has led me to a lot of trouble because sometimes without notice I can no longer use remote desktop to connect to my work box. There are ways to retrieve the IP. I can remote into a box with a static IP, which I have access to, from there I can retrieve the IP using the box’s name. That’s a lot of trouble and can be quite error prone.
I got tired of my box’s IP address changing on me… leaving me high and dry during critical times. So… I decided to do something about it. I wrote a python script that runs on interval and sends me an email notification whenever the ip changes.
I setup the script to run from my start up menu. So now whenever my machine starts up, the script just runs in the background polling for IP changes.
The script saves the last known IP after sending out the email. That way it knows the last known IP so that it only sends an email notification whenever the IP has actually changed from the last known good IP.
Now, I always know what my IP is.