A practical Node.js-based toolset for:
- Seamlessly importing
BIND9zone files into DigitalOcean's DNS system - DYNDNS: Automatically keeping your A/AAAA records up to date with your current IP address
- Clone the repo:
git clone https://github.com/fszontagh/bind2digitalocean.git
cd bind2digitalocean- Install dependencies:
npm install- Set up the required API token as an environment variable:
export DO_API_TOKEN="your_digitalocean_token"The dynamic-dns.js script allows you to automatically update DNS records when your public IP changes.
Run the script with no parameters to select which records to update:
./dynamic-dns.jsYou'll be prompted with a simple menu to choose the records (only A or AAAA types are supported):
1) List domains to select record for DYNDNS
2) DYNDNS list
b) Exit
1) domain.com
2) xyz.tld
3) example.tld
b) Back
1) xyz.domain.tld [A]
↳ Current IP: xxx.xxx.xxx.xxx
↳ TTL: 900
↳ Last checked: 2025. 04. 23. 19:19:06
↳ Last updated: 2025. 04. 23. 19:23:10
b) Back
d) Delete an entry
t) Set TTL for an entry
Once you've selected your records, run the script in cron mode:
./dynamic-dns.js --cronThis will fetch your public IP from https://api.ipify.org and update the chosen records.
It's recommended to schedule this via cron (e.g., every 5 minutes).
The import-bind-zone.js script lets you migrate BIND9-style zone files into DigitalOcean's DNS system.
./import-bind-zone.js <path_to_the_zone_file>./import-bind-zone.js <path_to_the_zone_file> --liveFeel free to open issues, suggest improvements, or fork the repo to contribute!