Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
ddns-server
Advanced tools
| ddnsd | ddns-server | ddns-client |
A Dynamic DNS (DDNS / DynDNS) server written in node.js.
This server is capable of all of the following:
This module consists of 3 plugins:
Commandline
Casual
# Core Library
npm install --save ddns-server
# Default Plugins
npm install --save ddns-rest
npm install --save ddns-nameserver
npm install --save ddns-webapp
For Development
git clone git@github.com:Daplie/node-ddns.git
pushd node-ddns/
mkdir node_modules/
git clone git@github.com:Daplie/ddns-rest.git node_modules/ddns-rest
git clone git@github.com:Daplie/ddns-nameserver.git node_modules/ddns-nameserver
git clone git@github.com:Daplie/ddns-webapp.git node_modules/ddns-webapp
Here's how to create your own nameserver and ddns api using only the default plugins.
'use strict';
require('ddns-server').create({
dnsPort: 53
, httpPort: 80
, filepath: path.join(require('os').homedir(), '.ddnsd.sqlite3')
, primaryNameserver: 'ns1.example.com'
, nameservers: [
{ name: 'ns1.example.com', ipv4: '192.168.1.101' }
, { name: 'ns2.example.com', ipv4: '192.168.1.102' }
]
}).listen();
You can follow this example verbatim and get working results.
There are three steps:
Create a Token
The device represents a physical device, like a server, Digital Ocean droplet, VPS, your laptop, or a Raspberry Pi
The domain is a domain the device is allowed to modify.
# node bin/ddns-jwtgen.js <<private key>> <<domain>> <<device name>>
node bin/ddns-jwtgen.js ./privkey.pem example.com digital-ocean-server-1 > srv1-example-com.jwt
Example: A record
curl 'http://localhost:80/api/com.daplie.ddns/dns' \
-X POST \
-H "Authorization: Bearer $(cat srv1-example-com.jwt)" \
-H "Content-Type: application/json; charset=UTF-8" \
-d '[
{ "registered": true
, "groupIdx": 1
, "type": "A"
, "name": "example.com"
, "device": "digital-ocean-server-1"
, "value": "127.0.0.1"
, "ttl": 600
, "token": "$(cat srv1-example-com.jwt)"
}
]'
And test
dig @127.0.0.1 example.com
Note: Yes, token
is used twice, but that's just a workaround for a current problem.
Note: value
will default to the IP address of the connecting client
Note: You can add multiple records for the same DNS host with various devices. This means that some clients will pick any available record at random or will access each device round-robin style.
Update a device IP
All A (and AAAA, if specified) records associated with the device digital-ocean-server-1
will be updated
with the supplied IP addresses:
curl 'http://localhost:80/api/com.daplie.ddns/devices' \
-X POST \
-H "Authorization: Bearer $(cat srv1-example-com.jwt)" \
-H "Content-Type: application/json; charset=UTF-8" \
-d '{
"name": "digital-ocean-server-1"
, "addresses": [ { "type": "A", "value": "127.0.0.1" } ]
}'
Note: groupIdx
must exist and token and be the same as set in the dns record
Example: other records
curl 'http://localhost:80/api/com.daplie.ddns/dns' \
-X POST \
-H "Authorization: Bearer $(cat srv1-example-com.jwt)" \
-d '[
{ "registered": true
, "groupIdx": 1
, "type": "CNAME"
, "name": "www.example.com"
, "value": "example.com"
, "ttl": 600
, "token": "'$(cat srv1-example-com.jwt)'"
}
]'
Note: Yes, token
is used twice, but that's just a workaround to another bug.
Note: MX records have the additional option priority
.
MIT + Apache2
FAQs
A Dynamic DNS API server and Nameserver and Web Interface
We found that ddns-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.