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
- Packaging documentation: https://packaging.python.org/en/latest/tutorials/packaging-projects/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dnsupdater-0.0.1.tar.gz.
File metadata
- Download URL: dnsupdater-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e625bad2ca072e34fa29768a7e71ba35e178f463c1e6b5ac4d31c826ec2a9a10
|
|
| MD5 |
3ef491b84b9ad154eceaee6861000855
|
|
| BLAKE2b-256 |
95f0554240ce279ceb2d18f9998f99ffc9cb4061adf0460b468940e69edf6386
|
File details
Details for the file dnsupdater-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dnsupdater-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
551fb78be4387408807a2a90ff5d529958654a778ae21bc12d7af554652d4a31
|
|
| MD5 |
85426a9f2baa2f3f1a4228b977afbbfd
|
|
| BLAKE2b-256 |
6355c93de4c60ad6c2908f582594458b4926a76d05d211a3419e71bcff76cddc
|