Skip to main content

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

Project description

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.

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

dnsupdater-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

dnsupdater-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file dnsupdater-0.1.0.tar.gz.

File metadata

  • Download URL: dnsupdater-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for dnsupdater-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d43e472747361b6cdba97f335ff341e24df71a623f082b75f9a717fc3b61653
MD5 46d8b9cde473531ca14b903e9bf79da7
BLAKE2b-256 196a82a2dd91934829f9ad8608763c34ddd83f528adcf5019c08bf72f899a9e5

See more details on using hashes here.

File details

Details for the file dnsupdater-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dnsupdater-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for dnsupdater-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62a68a6323e01771f685363f502a107b5470f84ce9d5241064f41874e86e4556
MD5 b89ae60acc215c9adad2381d740acdc3
BLAKE2b-256 8eca512652cb29c927f523bf5171c18d2219a9c3425e0d5f65d53cb640278363

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