Reports external IP address to specified email addresses and (optionally) updates a godaddy host to point to the specfic IP.
Two primary reasons:
- I want to access my home server via RDP from anywhere remotely.
- COVID-19 is giving me extra time to work on some fun side projects.
2 things need to be done before its ready to work.
- Fill out the appsettings.json file.
- RecipientEmails - Array of string emails ex: ["[email protected]"]
- Side note: you can send an email to a phone number and receive it as a text: https://email2sms.info/
- LogFileLocation - Optional, list the directory where you want to log, if not provided, it will log to the console.
- SendEmails - set this to true
- Set the email credentials, for EmailDisplayName, put a name in there, it'll show up as the sender in the email. Use app password feature in gmail.
- WaitTimeSeconds - The wait time between IP checks, I set it to an hour.
- Host - The host name you own on GoDaddy
- GoDaddyAPISecrets - GoDaddy API Key and Secret, and the URL you'd like to point to, testing API https://api.ote-godaddy.com or the production API https://api.godaddy.com
- RecipientEmails - Array of string emails ex: ["[email protected]"]
- Compile and run.
I have personally set this up as a service.
- Currently only supports gmail as the email provider and godaddy as the host provider.
- Uses http://checkip.amazonaws.com/ to find out external IP address.
- Uses a file logger/console logger.
Check the log file for output/exceptions.