npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ddns-cli

v1.3.2

Published

commandline dynamic dns client for node-ddns

Downloads

23

Readme

node-ddns-client

A commandline Dynamic DNS client for Node DDNS

Commandline

npm install --global ddns-cli
ddns \
  --hostname example.com \
  --answer 127.0.0.1 \
  --type A \
  --token token.txt \
  --services ns1.foo-dns-service.com,ns2.foo-dns-service.com

free domains for testing

There are two domains available:

  • *.daplie.me via ddns
  • *.testing.letssecure.org via ddns-testing

You can choose your own subdomain:

# <whatever>.daplie.me

ddns \
  --hostname aj \
  --email '[email protected]' \
  --answer 127.0.0.1 \
  --type A

# assigns aj.daplie.me

Or get a randomly assigned subdomain in the format rubber-duck-42


# <random>.daplie.me

ddns \
  --hostname aj.daplie.me \
  --email '[email protected]' \
  --answer 127.0.0.1 \
  --type A

# assigns rubber-duck-42.daplie.me

Here's an example using ddns-testing:

# <random>.testing.letssecure.org

ddns-testing \
  --random \
  --email '[email protected]' \
  --answer 127.0.0.1 \
  --type A

# assigns rubber-duck-42.letssecure.org

Note: these domains are restricted to a single device (see below)

multiple devices

** The --device option**

In the real world you probably have several servers with several IP addresses that all respond to the same domain.

The device option allows you to specify a different device which will add an ip record rather than overwrite an existing ip record.

ddns \
  --hostname example.com \
  --answer 127.0.0.1 \
  --device server-3
  --type A \
  --token token.txt \
  --services ns1.foo-dns-service.com,ns2.foo-dns-service.com

API

  • ddns.update({ servers, pathname, ddns })

NOTE: the API will change in a future version (currently there are some bad naming conventions), but I'll keep backwards compatibility.

var ddns = require('ddns-cli');

ddns.update({
  servers: [
    'ns1.example.net'
  , 'ns2.example.net'
  , 'ns3.example.net'
  , 'ns4.example.net'
  ]
, pathname: '/api/com.daplie.dns/ddns'
, ddns: [
    { "name": "example.com"
    , "value": "127.0.0.1"
    , "type": "A"
    , "priority": undefined
    , "token": "ef13...."   // jwt token
    , "ttl": 600            // 10 minutes
    , "device": "server-7"
    }
  , { "name": "example.com"
    , "value": "::1"
    , "type": "AAAA"
    , "priority": undefined
    , "token": "ef13...."   // jwt token
    , "ttl": 600            // 10 minutes
    , "device": "server-7"
    }
  ]
});

curl

For the curious curlers who would like to implement this in another language:

JWT="xyz.abc.xyz"
IP="127.0.0.1"
HOSTNAME="example.com"
DEVICE="foo"

curl -X POST https://ns1.example.net/api/com.daplie.dns/ddns \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "'$HOSTNAME'", "value": "'$IP'", "type": "A", "token": "'$JWT'", "ttl": 600, "device": "'$DEVICE'" }
  ]'

Note: the API may change to accept an array of tokens and an array of domains separately, but it will probably still need an Authorization Bearer token.

LICENSE

Dual-licensed MIT and Apache-2.0

See LICENSE