{"id":27260204,"url":"https://github.com/offsetmonkey538/cloudflare-ddns-updater","last_synced_at":"2025-04-11T04:08:25.366Z","repository":{"id":286999865,"uuid":"963239539","full_name":"OffsetMonkey538/cloudflare-ddns-updater","owner":"OffsetMonkey538","description":"Simple shell script that keeps a Cloudflare DNS record up to date with the current IPv4 and IPv6 address of the computer it's run on","archived":false,"fork":false,"pushed_at":"2025-04-09T13:19:09.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T04:08:22.261Z","etag":null,"topics":["cloudflare-api","cloudflare-dns","ddns","ddns-updater","dns","posix-sh","shell","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OffsetMonkey538.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-04-09T11:25:29.000Z","updated_at":"2025-04-10T13:09:05.000Z","dependencies_parsed_at":"2025-04-09T12:41:07.652Z","dependency_job_id":null,"html_url":"https://github.com/OffsetMonkey538/cloudflare-ddns-updater","commit_stats":null,"previous_names":["offsetmonkey538/cloudflare-ddns-updater"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffsetMonkey538%2Fcloudflare-ddns-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffsetMonkey538%2Fcloudflare-ddns-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffsetMonkey538%2Fcloudflare-ddns-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffsetMonkey538%2Fcloudflare-ddns-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OffsetMonkey538","download_url":"https://codeload.github.com/OffsetMonkey538/cloudflare-ddns-updater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339222,"owners_count":21087215,"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-api","cloudflare-dns","ddns","ddns-updater","dns","posix-sh","shell","shell-script"],"created_at":"2025-04-11T04:08:24.687Z","updated_at":"2025-04-11T04:08:25.356Z","avatar_url":"https://github.com/OffsetMonkey538.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare DDNS Updater\nThis script will keep the IPv4 and IPv6 addresses of Cloudflare DNS entries up to date with the current public IP address of the computer it is run on.\n\nIt uses the Cloudflare api and `jq` command for checking the IP address currently set for the DNS records and compares them with results from the [ipify.org](https://www.ipify.org/) api (https://api.ipify.org and https://api6.ipify.org)\n\nIf the IP addresses don't match, it will send a request to the Cloudflare api to set the new addresses.\n\n## Setting up\nFirst clone the repository and cd into it.\n\nFor configuration, rename the `.env-example` file to just `.env`. Then you can start filling it with values.\n### ZONE_ID\nYou can get the zone id from the [Cloudflare Dashboard](https://dash.cloudflare.com) by clicking on the domain you want. It should be on the right side of the screen.\n### API_TOKEN\nTo get the api token, go to your [Cloudflare Dashboard](https://dash.cloudflare.com) and scroll down to `Manage Account` on the left. Click on it and select `Account API Tokens`.  \nClick on `Create Token` and select the `Edit zone DNS` template. Select the correct zone and create the token.\n### DOMAIN\nSet this to the (sub)domain you want to be updated. (For example `server.example.com`)\n### RECORD_IDs\nGo to your [Cloudflare Dashboard](https://dash.cloudflare.com), select your domain and go to `DNS`.\n\nHere you need to create 2 DNS records for the same (sub)domain, one for IPv4 (Type A) and one for IPv6 (Type AAAA).  \nCreate them with the correct name, other settings will be filled by the script. For the address you can temporarily use `1.2.3.4` for IPv4 and `1:2:3:4:5:6:7:8` for IPv6.\n\nNow that the records are created, you need to get their ids.  \nTo do this, you can run the script like this: `LIST_RECORDS=true ./run.sh`, which will print the `A` and `AAAA` record ids for the `DOMAIN` you defined before.  \nFrom there, copy the values into the `.env` file.\n### TTL\nThe time-to-live of the records, in seconds. The default of 300 seconds (5 min) should be fine, but you can increase or decrease this if you plan on running the script at a different interval.\n\n## Running the script\nYou can set up cron to run the script. Just run the `crontab -e` command and paste in the following:\n```cronexp\n*/5 * * * * cd /path/to/cloudflare-ddns-updater \u0026\u0026 ./run.sh\n```\nThis will run the script every five minutes. It first has to cd into the directory as otherwise the script wouldn't be able to access the `.env` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffsetmonkey538%2Fcloudflare-ddns-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffsetmonkey538%2Fcloudflare-ddns-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffsetmonkey538%2Fcloudflare-ddns-updater/lists"}