CLI tool to manage cloudflare DNS records
Go to file
2023-04-12 10:18:41 -04:00
vendor Add vendor files, allowing compilation without internet 2023-04-12 10:01:37 -04:00
demo.cast add README, demo and LICENSE 2023-04-10 21:36:32 -04:00
go.mod change package name 2023-03-23 19:02:57 -04:00
go.sum Initial commit 2023-03-20 01:01:44 -04:00
LICENSE add README, demo and LICENSE 2023-04-10 21:36:32 -04:00
main_test.go fix ip parsing 2023-04-10 14:16:23 -04:00
main.go fix ip parsing 2023-04-10 14:16:23 -04:00
README.md improve doc 2023-04-12 10:18:41 -04:00

CLI tool to manage cloudflare DNS records

Installation

Using go

 go install go.balki.me/cloudflare-dns-cli@latest

Using docker

 mkdir -p $HOME/bin
 docker run --pull=always --rm -v "$HOME/bin:/op" golang sh -c "go install go.balki.me/cloudflare-dns-cli@latest && install -o $(id -u) -g $(id -g) /go/bin/cloudflare-dns-cli /op/"

Features

  1. Add/Modify A, AAAA, CNAME records
  2. List/Delete records
  3. Save all records in JSON format

Usage

Usage of cloudflare-dns-cli:
  -a string
        Cloudflare API Token. env var: CF_TOKEN
  -c string
        CNAME target
  -d string
        Domain name, e.g. example.com. env var: DOMAIN
  -i value
        IP address (default 127.0.0.1)
  -o string
        Path to save all records as json, e.g. ./records.json
  -s string
        Subdomain, e.g. blog. Use @ for root (default "<UNSET>")
  -x    Delete records of subdomain

Demo

===> HERE <===

Similar

Why another cli?

  1. Keep it simple with minimum dependency and features
  2. Uses libdns library maintained by caddy team. libdns provides uniform api for many dns providers. Mostly s/cloudflare/XYZ/ should work when moving to a different dns provider