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

digital-ocean-dynamic-dns

v1.1.3

Published

Dynamically update Domain Records on Digital Ocean

Downloads

4

Readme

digital-ocean-dynamic-dns

Dynamically update Domain Records on Digital Ocean.

Build Status

Installation

$ npm install -g digital-ocean-dynamic-dns

Basic Usage

You can specify an address with the -a parameter, or don't and dodd will use your public IP instead.

$ dodd -t <DigitalOceanApiToken> -a <someIp> -d <yourDomain.tld> -r <domainRecordTitle>
$ dodd -t <DigitalOceanApiToken> -d <yourDomain.tld> -r <domainRecordTitle>

Example with a specific IP

To change home.example.com to direct to 123.456.789.123:

$ dodd -t abc123def456ghi789 -a 123.456.789.123 -d example.com -r home

Example using the public IP

To change home.example.com to direct to whatever your public IP is:

$ dodd -t abc123def456ghi789 -d example.com -r home

Create

If the -c or --create flag is set and the record does not exist under the given domain, it will be created.

$ dodd -t abc123def456ghi789 -d example.com -r home --create

Config file

Using the -f or --file option, all parameters can be set from a JSON file. It's possible to specify multiple domains when the JSON file contains an array of domains. Any arguments passed on the command line will also be applied but will be overridden by the file contents.

$ dodd -t abc123def456ghi789 -f /path/to/file.json

/path/to/file.json

[
  {
    "domainName": "domain.tld",
    "recordName": "record"
  },
  {
    "token": "xyz987uvw654qrs321",
    "domainName": "other.tld",
    "recordName": "test"
  }
]

Run automatically

On Linux you can run dodd at boot and then repeatedly at a certain interval using systemd. Set up the command in systemd/dodd.service and set a time interal in systemd/dodd.timer. Then copy both to /etc/systemd/system/ and start them with

$ systemctl start dodd.service
$ systemctl start dodd.timer

To auto-start the service after boot run.

$ systemctl enable dodd.service
$ systemctl enable dodd.timer

The above will run dodd with the parameters defined in dodd.service after boot, as soon as the network is available. After that it will run the same command regularly as defined by the interval in the dodd.timer file (hourly by default).

You can veryify that the dodd timer is active by running systemctl list-timers.

More Options

There are more optional parameters. Use dodd --help for details.

$ dodd --help

  Usage: dodd [options]

  Options:

    -h, --help                             output usage information
    -t, --token <token>                    Your Digital Ocean API token
    -a, --address <address>                The address the DNS record should direct to. Uses the public IP if none is provided.
    -d, --domainName <domainName>          The domain name itself (<domainName>.tld)
    -r, --recordName <recordName>          The name of the comain record (<recordName>.domain.tld)
    -y, --recordType <recordType>          The type of DNS record (A, CNAME, TXT, ...). Defaults to A.
    -l, --recordTtl <recordTtl>            The time to live for the record, in seconds. Deafults to 1800.
    -p, --recordPriority <recordPriority>  The priority of the host (SRV and MX records only).
    -o, --recordPort <recordPort>          The port that the service is accessible on (SRV records only).
    -w, --recordWeight <recordWeight>      The weight of records with the same priority (SRV records only).
    -c, --create                           Create a new domain record if none exists. Creates the domain RECORD, not a domain.