Skip to main content

DNSupdater

PyPI - Version PyPI - Downloads

Update an Amazon Route53 or Cloudflare record with your current public IP address.

Credentials configuration

AWS

Easiest way is to install AWS CLI from here and then configure the credentials executing aws configure and provide access key and secret key for an IAM user with enough permissions to update the Route53 hosted zone.

Cloudflare

Set a Cloudflare token in CLOUDFLARE_API_TOKEN environment variable or create a proper configuration file ~/.cloudflare/cloudflare.cf

Full documentation here

How to run

From git

$ pwd
/home/user 
$ git clone git@github.com:diegofd/dnsupdater.git
$ cd dnsupdater
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ cd src

# For AWS
$ python3 -m dnsupdater.dnsupdater --name RECORD_NAME route53 --hosted-zone-id HOSTED_ZONE_ID

# For Cloudflare
$ python3 -m dnsupdater.dnsupdater --name RECORD_NAME cloudflare --domain DOMAIN

From package

Using virtualenv is recommended to not polute your system.

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install dnsupdater

# For AWS
$ dnsupdater --name RECORD_NAME route53 --hosted-zone-id HOSTED_ZONE_ID

# For Cloudflare
$ dnsupdater --name RECORD_NAME cloudflare --domain DOMAIN

How to schedule it with cron

Follow the steps above to install and configure a cron job to run every hour:

0 *     * * *   user   cd /home/user/dnsupdater && .venv/bin/python3 -m dnsupdater.dnsupdater --name sub.example.com route53 --hosted-zone-id ZXXXXXXXXXXX 

Cost

AWS

Estimated cost is $0.5 per hosted zone per month plus additional cost per DNS requests (none or tiny for a personal setup). Complete Route53 pricing information.

Cloudflare

Free.

Development

Feel free to open issues or send PRs.

Release files for dnsupdater 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dnsupdater 0.1.0
File Size Uploaded
dnsupdater-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dnsupdater 0.1.0
File Interpreter ABI Platform
dnsupdater-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / dnsupdater-0.1.0.tar.gz

Download URL dnsupdater-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2d43e472747361b6cdba97f335ff341e24df71a623f082b75f9a717fc3b61653
BLAKE2b-256 checksum
How to use checksums
196a82a2dd91934829f9ad8608763c34ddd83f528adcf5019c08bf72f899a9e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dnsupdater-0.1.0-py3-none-any.whl

Download URL dnsupdater-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62a68a6323e01771f685363f502a107b5470f84ce9d5241064f41874e86e4556
BLAKE2b-256 checksum
How to use checksums
8eca512652cb29c927f523bf5171c18d2219a9c3425e0d5f65d53cb640278363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page