All Projects → dvershinin → cloudflareddns

dvershinin / cloudflareddns

Licence: BSD-2-Clause license
DDNS with Cloudflare

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cloudflareddns

DnsTube
Access your computer from anywhere. DnsTube is a Windows .NET dynamic DNS client for Cloudflare.
Stars: ✭ 137 (+315.15%)
Mutual labels:  ddns, cloudflare
cloudflare-ddns-updater
Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH~
Stars: ✭ 434 (+1215.15%)
Mutual labels:  ddns, cloudflare
FileBasedMiniDMS
This php script sorts your documents (by using hardlinks) into subfolders based on the hashtags it finds in your documents filenames.
Stars: ✭ 35 (+6.06%)
Mutual labels:  synology, dsm
phpvirtualbox4dsm
PhpVirtualbox package for Synology DSM
Stars: ✭ 28 (-15.15%)
Mutual labels:  synology, dsm
AliDDNSNet
使用 C# + .NET Core 开发的开源 DDNS 工具,基于阿里云的 DNS API 接口。
Stars: ✭ 88 (+166.67%)
Mutual labels:  ddns, synology-nas
redpill-tool-chain
这是一个测试项目,可能会有不可预测的事情发生(比如:毁损数据、烧毁硬件等等),请谨慎使用。
Stars: ✭ 490 (+1384.85%)
Mutual labels:  synology, dsm
cloudflare-ddns
A script to update your Cloudflare DNS records at a glance.
Stars: ✭ 152 (+360.61%)
Mutual labels:  ddns, cloudflare
synology-update-plex
Script to Auto Update Plex Media Server on Synology NAS
Stars: ✭ 89 (+169.7%)
Mutual labels:  synology, synology-nas
Synologycloudflareddns
📜 Cloudflare DDNS script for Synology
Stars: ✭ 222 (+572.73%)
Mutual labels:  cloudflare, synology
Synologyddnscloudflaremultidomain
Synology DDNS Cloudflare service provider with multidomains and subdomains
Stars: ✭ 51 (+54.55%)
Mutual labels:  cloudflare, synology
AirConnect-Synology
Updated AirConnect packages for Synology NAS and Synology Router
Stars: ✭ 200 (+506.06%)
Mutual labels:  synology, synology-nas
Ddns
🚩 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
Stars: ✭ 2,582 (+7724.24%)
Mutual labels:  ddns, cloudflare
synology-decrypt
An open source implementation/description of the Synology Cloud Sync encryption/decryption algorithm
Stars: ✭ 91 (+175.76%)
Mutual labels:  synology, synology-nas
docker-ddns-cloudflare
Cloudflare DDNS Script
Stars: ✭ 21 (-36.36%)
Mutual labels:  ddns, cloudflare
synology-api
A Python wrapper around Synology API
Stars: ✭ 116 (+251.52%)
Mutual labels:  synology, synology-nas
hpool-miner
chia chia-miner hpool hpool-miner hpool-og-miner hpool-pp-miner Synology RaspberryPi
Stars: ✭ 22 (-33.33%)
Mutual labels:  synology, synology-nas
ddns
No description or website provided.
Stars: ✭ 26 (-21.21%)
Mutual labels:  ddns, cloudflare
ddns
a multiple providers ddns script without dependencies
Stars: ✭ 47 (+42.42%)
Mutual labels:  ddns, cloudflare
dynamic-dns-netcup-api
A simple dynamic DNS client written in PHP for use with the netcup DNS API.
Stars: ✭ 127 (+284.85%)
Mutual labels:  ddns
aliyun-ddns
[Go] Update Aliyun DDNS record from OpenWRT or CLI. 阿里云域名动态解析客户端, 万网, 云解析, Windows, Linux
Stars: ✭ 17 (-48.48%)
Mutual labels:  ddns

cloudflareddns

Build Status PyPI version Buy Me a Coffee

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 yum/dnf or pip

Synopsis

Update DNS A record for foo.example.com to 1.2.3.4

cloudflareddns --hostname foo.example.com --ip 1.2.3.4

Likewise, for an AAAA record:

cloudflareddns --hostname foo.example.com --ip 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Get all options by simply running cloudflareddns -h:

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

Update DDNS in Cloudflare.

optional arguments:
  -h, --help           show this help message and exit
  --email EMAIL        Cloudflare account email (omit if using API tokens)
  --key KEY            Cloudflare API key or token
  --hostname HOSTNAME  Hostname to set IP for
  --ip IP              The IP address
  --ttl TTL            TTL in seconds
  --verbose
  --version            show program's version number and exit

When invoked without any options, cloudflareddns will try to point the FQDN (aka <hostname>.<domain-name> of the machine it runs on to its public IP address (auto-detected).

Install and use with Synology DiskStations

You can configure a Synology DiskStation with CloudFlare DDNS.

It's worth noting that if your Synology DSM is recent enough, you can simply use Synology's own DDNS service, then create a CNAME record at your domain that points to it. The downside to this solution, however, is extra DNS lookup required to resolve domain to IP.

Alternative solution is to use cloudflaredns which ships with the necessary CLI interface for Synology compatibility: cloudflareddns-syno.

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 recommend you try out Putty for Windows.
  • Use your Synology admin account to connect.

Step 2. Install cloudflareddns

If you're not a lazy man, checkout instructions on installing using virtualenv for this step. For quick setup instead:

curl https://bootstrap.pypa.io/get-pip.py | python
pip install cloudflareddns

Run the following command to add new DDNS provider:

cat >> /etc/ddns_provider.conf << 'EOF'
[USER_Cloudflare]
        modulepath=/bin/cloudflareddns-syno
        queryurl=https://www.cloudflare.com/
EOF

Step 3. Get Cloudflare parameters

It is recommended to use a Cloudflare API token. Check the wiki page for instructions on how to get an API token with the most secure permissions.

Alternatively, you can get Cloudflare global API key in your account settings.

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
  • If using token authentication: enter x in the Username/Email, and API token as Password/Key. The requirement to put x is due to Synology GUI's constraints not allowing for an empty field
  • If using global API key: enter your Cloudflare account as Username/Email, and API key as Password/Key

Installation for CentOS/RHEL 7, 8

sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm
sudo yum install cloudflareddns

Installation for other systems

Installing with pip is easiest:

pip install cloudflareddns

Usage in Python scripts

from cloudflareddns import cloudflareddns
hostname = 'foo.example.com'
ip = '1.2.3.4'
if cloudflareddns.updateRecord(hostname, ip):
  print('Record is OK')
  ...

Requires using environment variables (see tips below).

Specifying Cloudflare credentials

In non-Synology systems, you can store Cloudflare credentials in either environment variables or a configuration file.

Via configuration file

Create ~/.cloudflare/cloudflare.cfg and put:

[CloudFlare]
email = [email protected] # Do not set if using an API Token
token = xxxxxxxxxxxxxxxxxxxxxxxxxxx

Via environment variables

You can put your Cloudflare credentials into the ~/.bashrc file:

export CF_API_EMAIL="[email protected]" # Do not set if using an API Token
export CF_API_KEY="xxxxxx"

Don't forget to source ~/.bashrc if you have just put credentials in there. The cloudflareddns will pick those up, so no need to pass --email or --key every time.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].