andreaskoch / dee-cli

Cross-platform command-line utility for DNS updates via DNSimple
Other
1 stars 0 forks source link

Dee CLI

Update DNS records from the command-line

dee is single self-contained command-line utility for updating subdomain records that are managed by DNSimple written go that works on Linux, Mac OS and Windows alike.

Build Status

Usage

dee <action> [arguments ...]

Get help:

dee --help

Actions:

Action: login

Save DNSimple API credentials to disc.

Arguments:

Example:

dee login -email apiuser@example.com -apitoken TracsiflOgympacKoFieC

The credentials are saved to: ~/.dee/credentials.json

Action: logout

Remove any stored DNSimple API credentials from disc.

dee logout

Action: list

List all available domains or subdomains.

Arguments

Examples

List all available domains:

dee list

List all subdomain of a given domain:

dee list -domain example.com

List all DNS records for a given subdomain:

dee list -domain example.com -subdomain www

Action: create

Create an address record.

Arguments:

Examples:

Create an AAAA record for the subdomain www:

dee create -domain example.com -subdomain www -ip 2001:0db8:0000:0042:0000:8a2e:0370:7334

Create an AAAA record for the subdomain www with TTL of 1 minute:

dee create -domain example.com -subdomain www -ip 2001:0db8:0000:0042:0000:8a2e:0370:7334 -ttl 60

Create an A record for the subdomain www:

dee create -domain example.com -subdomain www -ip 10.2.1.3

The -ip parameter can also be passed via Stdin:

echo "2001:0db8:0000:0042:0000:8a2e:0370:7334" | dee create -domain example.com -subdomain www -ttl 3600

Action: delete

Deletes an address record.

Arguments:

Examples:

Delete the IPv6 address record for www.example.com:

dee delete -domain example.com -subdomain www -type AAAA

Delete the IPv4 address record for www.example.com:

dee delete -domain example.com -subdomain www -type A

Action: update

Update the DNS record for a given sub domain

Arguments:

Examples:

Set the AAAA record of www.example.com to the given IP address:

dee update -domain example.com -subdomain www -ip 2001:0db8:0000:0042:0000:8a2e:0370:7334

The -ip address parameter can also be passed in via Stdin:

echo "2001:0db8:0000:0042:0000:8a2e:0370:7334" | dee update -domain example.com -subdomain www

Action: createorupdate

The create-or-update action can be used if you are not sure if the address record you are trying to update does already exist. If the record exists it will be just updated; if it does not yet exist it will be created with the given IP address.

Arguments:

Dependencies

dee uses the github.com/andreaskoch/dee-ns library for creating, reading, updating and delting DNSimple DNS records.

Installation & Build

Install dee-cli using go get:

go get -u github.com/andreaskoch/dee-cli

Compile dee-cli yourself:

go get -u github.com/andreaskoch/dee-cli
cd $GOPATH/github.com/andreaskoch/dee-cli
go run make.go -install

Compile the dee binaries for Linux (64bit, ARM, ARM5, ARM6, ARM7), Mac OS (64bit) and Windows (64bit):

cd $GOPATH/github.com/andreaskoch/dee-cli
go run make.go -crosscompile

Contribute

If you find a bug or if you want to add or improve some feature please create an issue or send me a pull requests. All contributions are welcome.

If you are planning to sign up for DNSimple and if you like this tool I would be happy if you use this link: https://dnsimple.com/r/381546095cf6a2

One month of free service for the both of us :dancers: