Skip to content

Little piece of code in NodeJS to replace dynamically your IP of a Gandi's domain by your actual external IP address (for those who have a dynamic IP and who have some domains at Gandi's company).

Notifications You must be signed in to change notification settings

GhyslainBruno/gandi-dyndns-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM

npm version

gandi-dyndns-node

This package is a very little piece of code (written in NodeJS) made just to be usefull.

Why ?

Because when you have some domain(s) at Gandi's and also have an IP dynamically changed you can't use a usual DynDns service.

How does it work ?

Will check what is your external IP address, using Gandi's service (http://me.gandi.net), check if the value at Gandi is the good one, and if not change it, quite simple.

In order to use it you just have to add options to the "update" command:

  • --domain-name: the domain on which you want to check the IP address
  • --name: the name of the record you want to check (basically "@", but could be different)
  • --type: the type of record you want to check (basically "A", but could be different)
  • --api-key: your personnal API Key (which can be found in here from the "security" section)

So basically, here is what you have to do to use it:

npm install -g gandi-dyndns-node
gandi --domain-name YOUR_DOMAIN_NAME --name NAME_OF_RECORD --type TYPE_OF_RECORD --api-key YOUR_API_KEY update

This code uses the LiveDNS API from the Gandi v5.

For any help you can refer to the Gandi documentation.

For any bugs, PR are welcomed.

Hope this helps.

Pro tips: using it in a cron task can be usefull.

Pro tips #2: here is the crontab task working for Raspbian (but should work everywere, I guess) :

*/5 * * * * /usr/local/lib/node_modules/gandi-dyndns-node/bin/gandyndnscli.js --domain-name YOUR_DOMAIN_NAME --name NAME_OF_RECORD --type TYPE_OF_RECORD --api-key YOUR_API_KEY update >> /tmp/gandi_dyndns_logs.txt

About

Little piece of code in NodeJS to replace dynamically your IP of a Gandi's domain by your actual external IP address (for those who have a dynamic IP and who have some domains at Gandi's company).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published