Skip to main content

A CLI tool to use Cloudflare as a DDNS provider

Project description

lastversion

Build Status PyPI version

A tiny command line utility for implementing DDNS with Cloudflare.

  • Supports virtually any server that is capable of running Python
  • Synology DiskStations supported
  • Quick to install using pip

Synopsys

Linux servers

usage: cloudflareddns [-h] [--email EMAIL] [--key KEY] [--hostname HOSTNAME]
                      [--ip IP] [--verbose] [--version]

Update DDNS in Cloudflare.

optional arguments:
  -h, --help           show this help message and exit
  --email EMAIL        Cloudflare account emai
  --key KEY            Cloudflare API key
  --hostname HOSTNAME  Hostname to set IP for
  --ip IP              The IP address
  --verbose
  --version            show program's version number and exit

Synology DiskStations

You can configure a Synology DiskStation with CloudFlare DDNS.

Step 1. Access Synology via SSH

  • Login to your DSM
  • Go to Control Panel > Terminal & SNMP > Enable SSH service
  • Use your client or commandline to access Synology. If you don't have any, I recommand you can try out MobaXterm for Windows.
  • Use your Synology admin account to connect.
  • Run the following command to add new DDNS provider:
cat >> /etc/ddns_provider.conf << 'EOF'
[USER_Cloudflare]
        modulepath=/usr/local/sbin/cloudflareddns.sh
        queryurl=https://www.cloudflare.com/
E*.

Step 2. Install cloudflareddns

curl https://bootstrap.pypa.io/get-pip.py | python
pip install virtualenv
# create virtualenv twice to ensure creation of "activate" script
virtualenv /usr/local/CloudflareDDNS
virtualenv /usr/local/CloudflareDDNS
# go inside our virtualenv
. /usr/local/CloudflareDDNS/bin/activate
# install the packages we need there (cloudflare will be used in the future):
pip install cloudflareddns

Step 3. Get Cloudflare parameters

Go to your account setting page and get API Key.

Step 4. Setup DDNS

  • Login to your DSM
  • Go to Control Panel > External Access > DDNS > Add
  • Select Cloudflare as service provider. Enter your domain as hostname, your Cloudflare account as Username/Email, and API key as Password/Key

Installation for CentOS 7

yum install https://extras.getpagespeed.com/release-el7-latest.rpm
yum install python2-cloudflareddns

Installation for other systems

Installing with pip is easiest:

pip install cloudflareddns

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

cloudflareddns-0.0.1.tar.gz (5.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page