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.


pip install do-dns-manager


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


We will call this file $HTPASSWD.

Run the DNS manager as follows:

DIGITAL_OCEAN_API_KEY='(api key)' do-dns-manager --keyfile=$HTPASSWD --port=8888 --address=

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

We will use curl examples:

# Add A record for
curl -u 'spam:password' -d @- <<EOF
{"op": "add", "address": "", "domain": "spam"}

# Add AAAA record for
curl -u 'spam:password' -d @- <<EOF
{"op": "add", "address": "::1", "domain": "spam"}

# Remove A record for
curl -u 'spam:password' -d @- <<EOF
{"op": "del", "address": "", "domain": "spam"}

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

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Files for do-dns-manager, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size do_dns_manager-0.1-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size do-dns-manager-0.1.tar.gz (17.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page