Skip to main content

A simple CLI client for AuroraDNS

Project description

auroradns-cli

A command line api client for PCextreme's AuroraDNS service based on Apache Libcloud.

Usage

usage: auroradns-cli.py [action] [arguments] (--help for more information)

AuroraDNS Command Line Interface

positional arguments:
  {list-zones,get-record,create-record,delete-record,update-record,create-zone,delete-zone,set-hostname}
                        Specify the action to perform.

optional arguments:
  -h, --help            show this help message and exit
  --details             print details
  --extras              print extras
  --force               do not prompt

authentication:
  --apikey APIKEY, -a APIKEY
                        dns api key
  --secretkey SECRETKEY, -s SECRETKEY
                        dns secret key

record arguments:
  -n NAME, --name NAME  dns name field, defaults to apex
  -d DATA, --data DATA  dns data/content field
  -p PRIO, --prio PRIO  dns record PRIO, mandatory for MX and SRV record types
  -t TYPE, --type TYPE  dns record type, defaults to A/AAAA based on DATA, mandatory otherwise
  --ttl TTL             dns record TTL
  --recordid RECORDID   dns record ID

zone arguments:
  -z ZONE, --zone ZONE  dns ZONE name
  --zoneid ZONEID       dns zone ID

Examples

List all records in a zone:

./auroradns-cli.py get-record --zone=mydomain.net
name              type       priority   ttl        data
----------------- ---------- ---------- ---------- ----------------------------------------------------------------------
@                 A                     900        203.0.113.20
*                 A                     900        203.0.113.20
@                 AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
*                 AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
@                 MX         10         900        primary.mail.pcextreme.nl
@                 MX         20         900        fallback.mail.pcextreme.nl
@                 NS                    3600       ns081.auroradns.eu
@                 NS                    3600       ns082.auroradns.nl
@                 NS                    3600       ns083.auroradns.info
@                 SOA                   4800       ns081.auroradns.eu admin.auroradns.eu 2019011401 86400 7200 604800 300

Filter on specific record types and ttl:

./auroradns-cli.py get-record --zone=mydomain.net --type=AAAA --ttl=900
name          type       priority   ttl        data
------------- ---------- ---------- ---------- ----------------------------------
@             AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
*             AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675

Create a new dns-record, IPv6 and IPv4 records are validated and record type is automatically set to AAAA or A if not specified. TTL defaults to zone default:

./auroradns-cli.py create-record --zone=mydomain.net --name=test123 --data=2001:db8:1337:dbfd:5054:3eff:feba:c1f3
Record created: test123.mydomain.net. 3600 IN AAAA 2001:db8:1337:dbfd:5054:3eff:feba:c1f3

Delete a record, multiple records can be removed if the filters return multiple results:

./auroradns-cli.py delete-record --zone=mydomain.net --name=mysubdomain --type=A
name                 type       priority   ttl        data
-------------------- ---------- ---------- ---------- ----------------------------
mysubdomain          AAAA                  3600       2001:db8:1337::5054:15ff:feb8:6a0e

Warning, you are about to delete the records shown above, this cannot be undone.
Type _uppercase_ yes to confirm: YES

Deleted record id 9f020b67-5b77-46e8-832c-0792280e3260: mysubdomain.mydomain.net. 3600 IN A 203.0.113.10

Automatically create or update AAAA-/A-records for the host

./auroradns-cli.py set-hostname
Record created: mysubdomain.mydomain.net. 3600 IN AAAA 2001:db8:1337::5054:15ff:feb8:6a0e
Record updated: mysubdomain.mydomain.net. 3600 IN A 203.0.113.10

Authentication

You can either pass the --apikey APIKEY and --secretkey SECRETKEY command line argumenrs or set the DNS_API_KEY and DNS_SECRET_KEY environment variables:

export DNS_API_KEY=MYAPIKEY; export DNS_SECRET_KEY=MYSECRETKEY

Setup

pip3 install auroradns-cli

Requirements

Ubuntu 16+

apt install python3 python3-pip python3-dev

CentOS 7

yum install python3 python3-pip python3-devel

License

  • MIT License

This is my first python project ever so there's probably a lot of code in here that doesn't even come close to being pythonic and some design choices that may seem very strange but they seemed logical to me at the time. So no guarantees on this whatsoever, use at your own risk. If this works for you, great, enjoy! If not, send me a message and I'll try to fix the issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auroradns-cli-0.3.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

auroradns_cli-0.3.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file auroradns-cli-0.3.0.tar.gz.

File metadata

  • Download URL: auroradns-cli-0.3.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4

File hashes

Hashes for auroradns-cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4146843e1bf22b6755f52ab4ff82db470ed6f75dccb76097514ee50c21cef0b1
MD5 7355c33570e1a90f4f51fd2db6e044a6
BLAKE2b-256 a0ed65066e578999938fc7830d84283bc801fbb4cac15f24c430d5852628ccb0

See more details on using hashes here.

File details

Details for the file auroradns_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: auroradns_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4

File hashes

Hashes for auroradns_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1f0399a76c8ca6e8fb0842b6cf6346ab7125c7f02c4dece2b38d9c4f96df75
MD5 56e78a40f41d63852ba98d1e341bd40e
BLAKE2b-256 cc4a8257e5cc01de1c2e77afaa60f2943221b2e98928e78bc6f4718a38c6596e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page