Noip.com Dynamic DNS update client built in Node.js. It makes easy to remote access your connected devices!
The easiest way to get no-ip is with npm:
$ npm install no-ip --save
or having it globally installed and used as a standalone tool:
$ npm install -g no-ip
var NoIP = require('no-ip')
var noip = new NoIP({
hostname: 'hello-world.ddns.net',
user: 'hello@world.com',
pass: 's3cr3tz'
})
noip.on('error', function(err){
console.log(err)
})
noip.on('success', function(isChanged, ip){
console.log(isChanged, ip)
})
noip.update() // Manual update, you can also provide a custom IP address
// noip.start() // start an automatic renewal every 1h by default or provide a custom ms.
// noip.stop() // stop the previously started automatic update
.on('success', callback)
: The callback accepts two params isChanged
and ip
that gives you the current IP address your domain is currently pointing to and a boolean value indicating if an update was performed.
.on('error', callback)
: Called when an error occurs.
.update([ip])
: Send an update request. Optionally you can provide a custom IP.
.start([ms])
: Start an automatic renewal every 1h by default or provide a custom ms.
.stop()
: Stop the automatic update.
.setOffline([boolean])
: Sets the current host to offline status. Offline settings are an Enhanced / No-IP Plus feature. You should call the update
method after this flag have been set.
.setIp([ip])
: Set a custom IP Address for the update requests.
If used standalone, I recommend you to start it with some process manager, like PM2.
$ no-ip -h hello-world.ddns.net -u hello -p s3cr3t -s
That start automatic DNS renewal once an hour. To see supported parameters and usage examples just type:
$ no-ip --help
This module makes use of the node DEBUG module.
You can enable it setting the DEBUG
env var to no-ip
before the app starts:
$ DEBUG=no-ip
Rocco Musolino (@roccomuso)
MIT