DDNS script to sync public IP address to CloudFlare dns records
Project description
The Python DDNS(Dynamic DNS) script for CloudFlare. It can sync your public IP address to DNS records on CloudFlare. It also provide the RESTful API to operate CloudFlare API v4.
Installation
pip install cloudflare-ddns
Examples
- Sync your public IP address to dns record on CloudFlare
- Command line
cloudflare-ddns email api_key domain
- Python execute package
python -m cloudflare_ddns email api_key domain
- Python code
from cloudflare_ddns import CloudFlare cf = CloudFlare(email, api_key, domain) cf.sync_dns_from_my_ip() #Successfully updated IP address from xx.xx.xx.xx to xx.xx.xx.xx
- RESTful dns record operation
cf.get_record('A', 'example.com')
cf.create_record('A', 'sub.example.com', '202.202.202.202')
cf.update_record('A', 'another.example.com', '202.202.202.202')
cf.delete_record('A', 'another.example.com')
Please note: The class will cache dns records information it gets from CloudFlare. To refresh cache, call ‘refresh’ method:
cf.refresh()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size cloudflare_ddns-1.0.0-py3-none-any.whl (6.3 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size cloudflare-ddns-1.0.0.tar.gz (4.6 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for cloudflare_ddns-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0998a91331f809b7b3402017671b0b91ae44cbacd1d9d1a32677a1a519d79d2 |
|
MD5 | 9007f2f07aaf25f2763036c9802f610e |
|
BLAKE2-256 | e6d753e1ab4e31d1f6a0930a2207e89fff221da88d6bcc02d7d96998c86c2638 |