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
Use command in command line
cloudflare-ddns email api_key domain
Execute python package in command line
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.
Source Distribution
cloudflare-ddns-1.0.1.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for cloudflare_ddns-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a506d68819966920783f03570b2a48c7aa79b24a09f54945829d1878f91479c |
|
MD5 | 021b9ad21525cdf707ba20a3fb05324d |
|
BLAKE2b-256 | 5da5b5ef91ddcb579b5f13699e9c2ea9cbf0dfd1ec14a994929fe5df0de90437 |