Noodles, Poodles and More!
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

digital-ocean-dynamic-dns

1.0.1 • Public • Published

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

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.

install

npm i digital-ocean-dynamic-dns

Downloadsweekly downloads

3

version

1.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability