Skip to main content

A DNS record manager using DigitalOcean as backend, useful for assigning DNS records in a DHCP hook.

Project description

A DNS record manager using DigitalOcean as backend, with its own authentication. Best suited when you just need something that changes the DNS, but you don’t want it to have access to other APIs, for example, APIs that can cost you money.

I find this particularly useful for assigning DNS records in a DHCP lease hook. An example hook is included as dnsmasq-hook for dnsmasq users.

Installation

pip install do-dns-manager

Configuration

Create htpasswd.txt somewhere containing lines of username and password pairs separated by :, for example:

spam:password
ham:hunter2

We will call this file $HTPASSWD.

Run the DNS manager as follows:

DIGITAL_OCEAN_API_KEY='(api key)' do-dns-manager --domain=example.com --keyfile=$HTPASSWD --port=8888 --address=127.0.0.1

Change (api key), example.com, $HTPASSWD, 8888 and 127.0.0.1 to fit your situation.

We will use curl examples:

# Add A record for spam.example.com
curl -u 'spam:password' http://127.0.0.1:8888 -d @- <<EOF
{"op": "add", "address": "127.0.0.1", "domain": "spam"}
EOF

# Add AAAA record for spam.example.com
curl -u 'spam:password' http://127.0.0.1:8888 -d @- <<EOF
{"op": "add", "address": "::1", "domain": "spam"}
EOF

# Remove A record for spam.example.com
curl -u 'spam:password' http://127.0.0.1:8888 -d @- <<EOF
{"op": "del", "address": "127.0.0.1", "domain": "spam"}
EOF

# Remove AAAA record for spam.example.com
# Using "address": "::1" instead of "type": "AAAA" also works
curl -u 'spam:password' http://127.0.0.1:8888 -d @- <<EOF
{"op": "del", "type": "AAAA", "domain": "spam"}
EOF

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

do-dns-manager-0.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

do_dns_manager-0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file do-dns-manager-0.1.tar.gz.

File metadata

  • Download URL: do-dns-manager-0.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for do-dns-manager-0.1.tar.gz
Algorithm Hash digest
SHA256 8ce3b379e61aa7db0b94c9b5ffb783986d7fc0f65cdf21d4e86b765a53a5b6d1
MD5 a88784e7b627ab64c8834e3935d14b54
BLAKE2b-256 95f05db4262313398a4da1d1cd35888575746d11d26ef7e1c7df43fc3c0d643c

See more details on using hashes here.

File details

Details for the file do_dns_manager-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for do_dns_manager-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7c963117d80b1f765bd9d5b57e930b898a656722031f29a14d44f589becf76c
MD5 933f02ea2b30dae775fe8738231afc38
BLAKE2b-256 4450d20d1d09b503c769d3cc2093225a33f1c70f8b19c3f0d1c72f1b82b5d5bc

See more details on using hashes here.

Supported by

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