I need something to update my account at noip with the correct external IP.
There are a few methods of doing it:
- NPM public-ip
- https://ipecho.net/plain
- Shell command dig +short myip.opendns.com @resolver1.opendns.com
- My router knows my external IP so I could parse it or google / what is my ip / ...
- StackOverflow
- git clone this repo
- npm install # on OpenBSD it may take a while and be issued more than once (SQLite3)
- cp .env-temp .env
- $EDITOR .env
npm run updateIP
I use it on my server and my crontab looks like this:
$ crontab -l
SHELL=/bin/sh
MAILTO=adam
HOME=/home/adam/noip-client
#
#minute (0-59)
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
#### update IP every 3 hours and at every reboot
27 */3 * * * npm run updateIP
@reboot npm run updateIP
Every once in a while I receive an email from noip saying ACTION REQUIRED: $YOURHOSTNAME is Expiring Soon and I need to click on Confirm Hostname. Do not neglect it!
-
If you see in your logs (in my.db) something like this YOUR_IP_IF_YOU_WANT_TO_PROVIDE it may and probably means you run this program simply with
node index
, where it should be ideally run like thisnpm run updateIP
. This way the correct IP will be provided (hopefully) OR there is a problem with your network. Check the error bit. -
The logged time is the UTC zone (JS function new Date().toUTCString()).