Skip to main content

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

Project description

DNSupdater

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

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.0.2.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.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dnsupdater-0.0.2.tar.gz
Algorithm Hash digest
SHA256 06047549b91f54486960e214c158ca63c659752a9908d569fcc1e7c848188996
MD5 ce689d01eb7bae987131c7c8c32f6953
BLAKE2b-256 005e0c33bfcbc619ee753133999b169122b4e0875b91f71d7d9ea8b54872f84c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dnsupdater-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb8dbcad2b4c229bbd2fe69666233c8f0f1f07ca14c89c60e29e903ef7fc643a
MD5 392fb6f2e21106b69543b2e448bb6e98
BLAKE2b-256 44434953129eca1bdcb1a8cd8250509890b81c6d1307eb9d964e4fae7581abfe

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