Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhinav-ark/cron_ddns
Cron based Cloudflare DDNS.
https://github.com/abhinav-ark/cron_ddns
api bash cloudflare ddns-script linux
Last synced: 23 days ago
JSON representation
Cron based Cloudflare DDNS.
- Host: GitHub
- URL: https://github.com/abhinav-ark/cron_ddns
- Owner: Abhinav-ark
- License: gpl-3.0
- Created: 2024-11-22T22:59:32.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-02T00:29:48.000Z (24 days ago)
- Last Synced: 2024-12-02T01:25:56.775Z (24 days ago)
- Topics: api, bash, cloudflare, ddns-script, linux
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cron DDNS
A Cron based Bash script for `linux` systems to periodically update Cloudflare DNS records.## How to setup?
1. You need a `Cloudflare Domain` (or) transfer your Domain to [Cloudflare](https://developers.cloudflare.com/registrar/get-started/transfer-domain-to-cloudflare/).
2. Get the [API Key](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) and [ZoneID](https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/) from Cloudflare Dashboard.3. Get the `RECORD ID` for the subdomain you want to manage.
Use Cloudflare API to get record `id` from your desired record.
```bash
curl --request GET \
--url https://api.cloudflare.com/client/v4/zones//dns_records \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '
```4. Install cron on the system if not already present
If you are using Ubuntu
```bash
apt-get update && apt-get upgrade
```
```bash
apt-get install cron
```
Verify your installation using
```bash
systemctl status cron
```5. Clone this Repository.
```git
git clone https://github.com/Abhinav-ark/cron_ddns.git
```6. create a `.env` file and add the env variables specified below.
```bash
touch .env
```7. Run main.bash
```bash
bash main.bash
```## .env File Format
```.env
API_KEY=""
ZONE_ID=""
RECORD_ID=""
DNS_NAME=""
IP_FILE=""
LOG_FILE=""
```