{"id":15648838,"url":"https://github.com/dvershinin/cloudflareddns","last_synced_at":"2026-03-04T13:03:07.253Z","repository":{"id":50938301,"uuid":"191766491","full_name":"dvershinin/cloudflareddns","owner":"dvershinin","description":"DDNS with Cloudflare","archived":false,"fork":false,"pushed_at":"2023-12-03T07:33:53.000Z","size":37,"stargazers_count":42,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T21:17:25.272Z","etag":null,"topics":["cloudflare","cloudflareddns","ddns","dns","dsm","python","synology","synology-diskstations","synology-nas"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvershinin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dvershinin"}},"created_at":"2019-06-13T13:17:20.000Z","updated_at":"2025-02-15T23:58:28.000Z","dependencies_parsed_at":"2023-12-03T08:25:53.804Z","dependency_job_id":"cefbc0b0-a596-4acc-ac4b-774d384dc6db","html_url":"https://github.com/dvershinin/cloudflareddns","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.5151515151515151,"last_synced_commit":"a61174216b79e0d4a10ff2571f439095829c4ca8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Fcloudflareddns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Fcloudflareddns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Fcloudflareddns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Fcloudflareddns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvershinin","download_url":"https://codeload.github.com/dvershinin/cloudflareddns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249153953,"owners_count":21221330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflareddns","ddns","dns","dsm","python","synology","synology-diskstations","synology-nas"],"created_at":"2024-10-03T12:26:37.735Z","updated_at":"2025-10-19T12:18:39.417Z","avatar_url":"https://github.com/dvershinin.png","language":"Python","funding_links":["https://github.com/sponsors/dvershinin","https://www.buymeacoffee.com/dvershinin"],"categories":[],"sub_categories":[],"readme":"# cloudflareddns \n\n[![Build Status](https://travis-ci.org/dvershinin/cloudflareddns.svg?branch=master)](https://travis-ci.org/dvershinin/cloudflareddns)\n[![PyPI version](https://badge.fury.io/py/cloudflareddns.svg)](https://badge.fury.io/py/cloudflareddns)\n[![Buy Me a Coffee](https://img.shields.io/badge/dynamic/json?color=blue\u0026label=Buy%20me%20a%20Coffee\u0026prefix=%23\u0026query=next_time_total\u0026url=https%3A%2F%2Fwww.getpagespeed.com%2Fbuymeacoffee.json\u0026logo=buymeacoffee)](https://www.buymeacoffee.com/dvershinin)\n\nA tiny command line utility for implementing DDNS with Cloudflare.\n\n* Supports virtually any server that is capable of running Python\n* Synology DiskStations supported\n* Quick to install using `yum/dnf` or `pip`\n\n## Synopsis\n\nUpdate DNS A record for `foo.example.com` to `1.2.3.4`\n\n```bash\ncloudflareddns --hostname foo.example.com --ip 1.2.3.4\n```\n\nLikewise, for an AAAA record:\n\n```bash\ncloudflareddns --hostname foo.example.com --ip 2001:0db8:85a3:0000:0000:8a2e:0370:7334\n```\n\nGet all options by simply running `cloudflareddns -h`:\n\n```\nusage: cloudflareddns [-h] [--email EMAIL] [--key KEY] [--hostname HOSTNAME]\n                      [--ip IP] [--ttl TTL] [--verbose] [--version]\n\nUpdate DDNS in Cloudflare.\n\noptional arguments:\n  -h, --help           show this help message and exit\n  --email EMAIL        Cloudflare account email (omit if using API tokens)\n  --key KEY            Cloudflare API key or token\n  --hostname HOSTNAME  Hostname to set IP for\n  --ip IP              The IP address\n  --ttl TTL            TTL in seconds\n  --verbose\n  --version            show program's version number and exit\n```\n\nWhen invoked without any options, `cloudflareddns` will try to point the\nFQDN (aka `\u003chostname\u003e.\u003cdomain-name\u003e` of the machine it runs on to its public IP address (auto-detected).\n\n## Install and use with Synology DiskStations\n\nYou can configure a Synology DiskStation with CloudFlare DDNS.\n\n**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.**\n\nAlternative solution is to use `cloudflaredns` which ships with the necessary CLI interface for Synology compatibility: `cloudflareddns-syno`.\n    \n### Step 1. Access Synology via SSH\n\n* Login to your DSM\n* Go to Control Panel \u003e Terminal \u0026 SNMP \u003e Enable SSH service\n* Use your client or commandline to access Synology. If you don't have any, I recommend you try out Putty for Windows.\n* Use your Synology admin account to connect.\n\n### Step 2. Install `cloudflareddns`\n\nIf you're not a lazy man, checkout [instructions on installing using virtualenv](SAFE-INSTALL.md) for this step.\nFor quick setup instead:\n\n    curl https://bootstrap.pypa.io/get-pip.py | python\n    pip install cloudflareddns\n\nRun the following command to add new DDNS provider:\n\n```\ncat \u003e\u003e /etc/ddns_provider.conf \u003c\u003c 'EOF'\n[USER_Cloudflare]\n        modulepath=/bin/cloudflareddns-syno\n        queryurl=https://www.cloudflare.com/\nEOF\n```\n\n### Step 3. Get Cloudflare parameters\n\nIt is recommended to use a Cloudflare API *token*.\nCheck the [wiki page](https://github.com/dvershinin/cloudflareddns/wiki/Token-Authentication) \nfor instructions on how to get an API token with the most secure permissions.\n\nAlternatively, you can get Cloudflare global API key in your account settings.\n\n### Step 4. Setup DDNS\n\n* Login to your DSM\n* Go to Control Panel \u003e External Access \u003e DDNS \u003e Add\n* Select Cloudflare as service provider\n* Enter your domain as hostname\n* If using token authentication: enter `x` in the Username/Email, and API token as Password/Key.\nThe requirement to put `x` is due to Synology GUI's constraints not allowing for an empty field   \n* If using global API key: enter your Cloudflare account as Username/Email, and API key as Password/Key\n\n## Installation for CentOS/RHEL 7, 8\n\n    sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm\n    sudo yum install cloudflareddns\n    \n## Installation for other systems\n\nInstalling with `pip` is easiest:\n\n    pip install cloudflareddns\n\n## Usage in Python scripts\n\n```python\nfrom cloudflareddns import cloudflareddns\nhostname = 'foo.example.com'\nip = '1.2.3.4'\nif cloudflareddns.updateRecord(hostname, ip):\n  print('Record is OK')\n  ...\n```\n\nRequires using environment variables (see tips below).\n\n## Specifying Cloudflare credentials\n\nIn non-Synology systems, you can store Cloudflare credentials in either environment \nvariables or a configuration file.\n\n### Via configuration file\n\nCreate `~/.cloudflare/cloudflare.cfg` and put:\n\n```ini\n[CloudFlare]\nemail = user@example.com # Do not set if using an API Token\ntoken = xxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n### Via environment variables\n\nYou can put your Cloudflare credentials into the `~/.bashrc` file:\n\n```bash\nexport CF_API_EMAIL=\"user@example.com\" # Do not set if using an API Token\nexport CF_API_KEY=\"xxxxxx\"\n```\n\nDon't forget to `source ~/.bashrc` if you have just put credentials in there.\nThe `cloudflareddns` will pick those up, so no need to pass `--email` or `--key` every time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvershinin%2Fcloudflareddns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvershinin%2Fcloudflareddns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvershinin%2Fcloudflareddns/lists"}