Note: This tool is under active development.
Cloud DNS CLI - manage DNS records across multiple providers!
cdnscli is a powerful cross-platform utility for managing DNS records and zones across multiple DNS providers, written in Go.
It provides convenient tools for both task automation and manual management through the terminal.
The utility supports two modes of operation:
- Classic CLI: Perfect for use in scripts, automation, and executing standalone commands.
- TUI (Text User Interface): An interactive text-based interface for more convenient management.
- Manage zones and resource records: add, modify, and delete them.
- Retrieve detailed information about zones and records.
- Search DNS records by various parameters.
- Export and import resource record sets in a convenient format.
- Easy-to-use interface, ideal for administrators and developers.
| Provider | Authentication | Features | Status |
|---|---|---|---|
| Cloudflare | API Token API Key + Email |
✅ Add/Update/Delete records ✅ List zones and records ✅ Search records ✅ Multiple accounts support ✅ Custom display names |
✅ Fully Supported |
Note: More providers are planned for future releases. If you'd like to see support for a specific provider, please open an issue.
cdnscli helpLogin to Cloudflare dash.
Go to My Account -> API Tokens and create a new token.
Create a configuration file ~/.cdnscli.yaml in your home directory:
Tip: You can copy the example configuration file from the repository:
cp cdnscli.yaml.example ~/.cdnscli.yaml
Then edit the file with your credentials:
default-provider: cloudflare
client-timeout: 10s
output-format: text
debug: false
providers:
cloudflare:
type: cloudflare
# display-name: Cloudflare # Optional: custom display name for the provider (defaults to "Cloudflare" for cloudflare type)
credentials:
api-token: your-cloudflare-api-token-here
# Alternative authentication (api-key + email):
# credentials:
# api-key: your-api-key
# email: [email protected]You can configure multiple providers of the same type (e.g., multiple Cloudflare accounts) by giving them different names:
default-provider: cf-production
client-timeout: 10s
output-format: text
debug: false
providers:
cf-production:
type: cloudflare
display-name: Cloudflare Production # Optional: custom display name
credentials:
api-token: production-account-token
cf-staging:
type: cloudflare
display-name: Cloudflare Staging # Optional: custom display name
credentials:
api-token: staging-account-token
cf-personal:
type: cloudflare
# display-name is optional - if not specified, defaults to "Cloudflare"
credentials:
api-token: personal-account-tokenTo switch between providers, change the default-provider value in the config file, or use the default provider specified in the config.
You can also use environment variables instead of a config file:
export CLOUDFLARE_API_TOKEN=your-cloudflare-api-token-here
# or
export CDNSCLI_PROVIDERS_CLOUDFLARE_CREDENTIALS_API_TOKEN=your-cloudflare-api-token-here
# Note: environment variables use underscores, not dashesFor multiple providers, you can use environment variables with the provider name:
# Set default provider
export CDNSCLI_DEFAULT_PROVIDER=cf-production
# Configure each provider
export CDNSCLI_PROVIDERS_CF_PRODUCTION_CREDENTIALS_API_TOKEN=production-account-token
export CDNSCLI_PROVIDERS_CF_STAGING_CREDENTIALS_API_TOKEN=staging-account-token
export CDNSCLI_PROVIDERS_CF_PERSONAL_CREDENTIALS_API_TOKEN=personal-account-tokenEnvironment variables follow the pattern: CDNSCLI_PROVIDERS_<PROVIDER_NAME>_CREDENTIALS_<CREDENTIAL_KEY>
List all zones:
cdnscli zone listList zones with JSON output:
cdnscli zone list --output-format jsonGet information about a specific zone:
cdnscli zone info example.comAdd a new A record:
cdnscli rr add -t A -n www -z example.com -c 192.0.2.2Add a CNAME record:
cdnscli rr add -t CNAME -n blog -z example.com -c example.github.ioAdd an MX record with priority:
cdnscli rr add -t MX -n example.com -z example.com -c "10 mail.example.com"Update an existing record:
cdnscli rr update -t A -n www -z example.com -c 192.0.2.3Change a record (with full SOA example):
cdnscli rr change --name example.com --zone example.com --type SOA --content "ns1.example.com. admins.example.com. 1970010100 1800 900 604800 86400"Delete a record:
cdnscli rr del -t A -n www -z example.comList all records in a zone:
cdnscli rr list -z example.comList records with JSON output:
cdnscli rr list -z example.com --output-format jsonGet detailed information about a specific record:
cdnscli rr info -t A -n www -z example.comSearch for records by name:
cdnscli search -n wwwSearch for records by type:
cdnscli search -t ASearch for records in a specific zone:
cdnscli search -z example.comIf you have multiple providers configured, switch between them by changing default-provider in your config file, or specify the provider in commands (if supported).
Use JSON output for scripting:
cdnscli zone list --output-format json | jq '.[] | select(.name == "example.com")'Use text output (default):
cdnscli zone list --output-format textDownload the latest release from GitHub Releases and extract the binary for your platform.
macOS (Intel):
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Darwin_x86_64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/macOS (Apple Silicon):
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Darwin_arm64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/Linux:
# For amd64
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Linux_x86_64.tar.gz | tar -xz
# For arm64
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Linux_arm64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/Windows:
Download the appropriate cdnscli_Windows_x86_64.zip or cdnscli_Windows_arm64.zip from the releases page and extract the cdnscli.exe file.
Install using Homebrew:
brew install mixanemca/tap/cdnscliInstall directly from source:
go install github.com/mixanemca/cdnscli@latestNote: You can also install a specific version by replacing
@latestwith@v0.99.0(or any other version tag).
git clone https://github.com/mixanemca/cdnscli.git
cd cdnscli
make
make installmake test