Skip to main content

A simple Cloudflare DNS CLI tool

Project description

cfcommander

cfcommander is a simple CLI tool for managing DNS records in Cloudflare. After installing via pip, you can use it with the cf command.

Installation

pip install cfcommander

Configuration

Before using the tool, configure your Cloudflare API credentials:

cf config your_email@example.com your_api_key

This saves your credentials to ~/.cfcli_config.json.

Usage

Add a DNS record

cf add example.com A home 192.0.2.1 yes 120
  • example.com – The zone name (your domain).
  • A – Record type (A, CNAME, etc.).
  • home – Subdomain (creates home.example.com).
  • 192.0.2.1 – The record value (e.g., an IP address).
  • yes – Whether the record is proxied through Cloudflare (yes/no).
  • 120 – TTL (Time-To-Live in seconds).

Edit a DNS record

cf edit example.com A home 198.51.100.42 no 300

Delete a DNS record

cf del example.com A home

List all DNS records for a domain

cf list example.com

List all manageable domains

cf domains

Examples

# Configure API credentials
cf config user@example.com my_api_key

# Add an A record for home.example.com
cf add example.com A home 203.0.113.10 no 3600

# Modify an existing record
cf edit example.com A home 198.51.100.42 yes 1800

# Delete a record
cf del example.com A home

# List all DNS records for a domain
cf list example.com

# List all domains under your Cloudflare account
cf domains

Dependencies

  • Python 3.6+
  • Required libraries: requests, argparse, tabulate, json, sys, os, textwrap

License

MIT License © Jakub Jim Zacek

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfcommander-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

cfcommander-0.1.2-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cfcommander-0.1.2.tar.gz.

File metadata

  • Download URL: cfcommander-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for cfcommander-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b5e6881c0e943625400c995cca611d1d539764135884cfcd905f1747e62b7c2
MD5 868c933b988cea8527365b33406e1c07
BLAKE2b-256 b0d175cd14e93786019df30b80ae1109350b45106d414474d6bad64c5165cfe8

See more details on using hashes here.

File details

Details for the file cfcommander-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: cfcommander-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for cfcommander-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fbf0799a7287fff661864c95d809efee9b91c83eb4b6830731679f61eb713406
MD5 7ad81084426d9e3113e95d3e2740923d
BLAKE2b-256 79ed29212dc9ad4ec349febc0b49bd77b8c45bb893208661c114498b36899694

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page