Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/undefinedplayer/cloudflare-ddns
DDNS script to sync public IP address to CloudFlare dns records.
https://github.com/undefinedplayer/cloudflare-ddns
cloudflare ddns
Last synced: about 2 months ago
JSON representation
DDNS script to sync public IP address to CloudFlare dns records.
- Host: GitHub
- URL: https://github.com/undefinedplayer/cloudflare-ddns
- Owner: undefinedplayer
- License: mit
- Created: 2016-12-24T23:23:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T03:42:03.000Z (11 months ago)
- Last Synced: 2024-09-19T00:44:20.510Z (3 months ago)
- Topics: cloudflare, ddns
- Language: Python
- Homepage: https://pypi.python.org/pypi/cloudflare-ddns/
- Size: 43 KB
- Stars: 40
- Watchers: 2
- Forks: 13
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===============
cloudflare-ddns
===============
.. image:: https://img.shields.io/pypi/v/cloudflare-ddns.svg
:target: https://pypi.python.org/pypi/cloudflare-ddns.. image:: https://img.shields.io/pypi/l/cloudflare-ddns.svg
:target: https://pypi.python.org/pypi/cloudflare-ddns.. image:: https://img.shields.io/pypi/wheel/cloudflare-ddns.svg
:target: https://pypi.python.org/pypi/cloudflare-ddns.. image:: https://img.shields.io/pypi/pyversions/cloudflare-ddns.svg
:target: https://pypi.python.org/pypi/cloudflare-ddnsThe 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
------------.. code:: shell
pip install cloudflare-ddns
Examples
--------#. Sync your public ip address to dns record on CloudFlare
- Use command in command line
.. code:: shell
cloudflare-ddns email api_key domain
- Print command line help
.. code:: shell
cloudflare-ddns --help
- Execute python package in command line
.. code:: shell
python -m cloudflare_ddns email api_key domain --proxied
- Python code
.. code:: python
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
.. code:: python
cf.get_record('A', 'example.com')
.. code:: python
cf.create_record('A', 'sub.example.com', '202.202.202.202')
.. code:: python
cf.update_record('A', 'another.example.com', '202.202.202.202')
.. code:: python
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:*
.. code:: python
cf.refresh()