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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dnsupdater-0.0.3.tar.gz
Algorithm Hash digest
SHA256 69e0a0792f299bc78d8da4f73ae0cef7de7314545ed5217b97e751fe36aff558
MD5 30b7ce9960d52d633a74162d4b77edc7
BLAKE2b-256 13ea40d465761d9eb0cd18ed70c536dc5085ca3f17e7674f281883d1aed76457

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dnsupdater-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4fac120e3574a0d25a6d0a4e7444ab3eca5036fe2c26ca758acb2c84b7666cba
MD5 a0536ab5cb4f7f9fce2bbb861fdf4851
BLAKE2b-256 5acdfbc09da78abe7f2dc890cbf502b66176e763783e24a26cfc22be89be8ae3

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