Skip to main content

Secure, version-controlled DNS management tool with CLI and GUI

Project description

DNSCTL Icon

DNSCTL

Secure, version-controlled DNS management for Cloudflare (CLI + GUI)

DNSCTL is a local infrastructure tool for safely managing Cloudflare DNS records using a Git-backed state model, drift detection, and a plan/apply workflow.

It combines:

  • A powerful CLI for automation
  • A PyQt GUI for visualization
  • Secure secret handling
  • Version-controlled state
  • Protected record enforcement

Think of it as a lightweight, DNS-focused reconciliation engine for Cloudflare.


✨ Key Features

  • State Sync — Pull DNS records into local JSON state
  • Local Editing — Add / edit / delete records safely
  • Drift Detection — Detect out-of-band dashboard changes
  • Plan / Apply Workflow — Preview before pushing
  • Protected Records — System + user-defined protection
  • Git-Backed History — Every state change auto-committed
  • Secure Token Storage — AES-GCM encrypted + OS keyring
  • Session Locking — Auto-expires after inactivity
  • CLI + GUI Parity — Same core engine

📦 Installation

Windows

Download the installer from the Releases page.

The installer includes both CLI and GUI applications with all dependencies bundled.

macOS / Linux

git clone https://github.com/dhivijit/dnsctl.git
cd dnsctl
pip install .

Requirements:

  • Python 3.11+
  • Git
  • OS keyring support (macOS Keychain / Linux Secret Service)

Note: For development mode, use pip install -e .


🚀 Quick Start

1. Initialize local state

dnsctl init

2. Store your Cloudflare API token (encrypted)

dnsctl login

The token is:

  • Encrypted with AES-256-GCM
  • Key derived via PBKDF2 (200k iterations)
  • Stored securely in OS keyring

3. Unlock session

dnsctl unlock

4. Sync zones

dnsctl sync

🧰 CLI Overview

Authentication

dnsctl init
dnsctl login
dnsctl unlock
dnsctl lock
dnsctl logout

Sync & Status

dnsctl sync [-z ZONE]
dnsctl status
dnsctl diff
dnsctl plan
dnsctl apply

Record Management (Local State)

dnsctl add --type A --name sub.example.com --content 1.2.3.4
dnsctl edit --type A --name sub.example.com --content 5.6.7.8
dnsctl rm --type A --name sub.example.com

Protected Records

dnsctl protect --type A --name example.com --reason "Critical root record"
dnsctl unprotect --type A --name example.com
dnsctl protected

History & Rollback

dnsctl log
dnsctl rollback <commit_sha>

Import / Export

dnsctl export
dnsctl import zone.json

🖥 GUI

Launch:

dnsctl-g

Features:

  • Zone selector
  • Record type tabs (A, CNAME, MX, TXT, etc.)
  • Drift status indicator
  • Sync / Plan / Apply controls
  • Record add/edit/delete dialogs
  • History & rollback viewer
  • Session unlock modal

The GUI uses the same reconciliation engine as the CLI.


🔐 Security Model

DNSCTL is designed for secure local infrastructure management.

Token Handling

  • API token is never stored in plaintext
  • Encrypted with AES-GCM
  • Derived from master password using PBKDF2-HMAC-SHA256
  • Encrypted blob stored in OS keyring
  • Session auto-expires (default: 15 minutes)

Protected Records

Two layers of protection:

  1. System-level (e.g., NS records)
  2. User-defined protection flags

Protected records require explicit force to modify or delete.


🧠 Design Philosophy

DNSCTL is built around:

  • Explicit change control
  • Safe reconciliation
  • Drift awareness
  • Secure secret handling
  • Recoverable state

It is intended for developers and security engineers who want more control than a web dashboard provides.


⚠️ Scope

DNSCTL is:

  • A local DNS management tool
  • Designed for single-user environments
  • Focused on Cloudflare DNS

It is not:

  • A multi-user SaaS system
  • A remote secret manager
  • A full Terraform replacement

📜 License

MIT License
© Dhivijit

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

dnsctl_app-1.0.0.tar.gz (66.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dnsctl_app-1.0.0-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file dnsctl_app-1.0.0.tar.gz.

File metadata

  • Download URL: dnsctl_app-1.0.0.tar.gz
  • Upload date:
  • Size: 66.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dnsctl_app-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a7722dcbd3971bb9384a94d4d98b35d74eaa66c801809095e87a159b811cd44b
MD5 6054b4efd25c9e8f772eb810f37d9b68
BLAKE2b-256 8ce0a7d6bd48a7d86504a234dd7a8094d7aeb797ff7dd96d1499ffba6301d092

See more details on using hashes here.

File details

Details for the file dnsctl_app-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dnsctl_app-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dnsctl_app-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b97b411223edd64adb9d4ab78fe1a10638fede3f3e59120c303925fa490e65fe
MD5 2e2f8bc94b4aa82c42f8f82983e5122f
BLAKE2b-256 2f7fd0f201d2cb62582673917fb9ea3dce0174b2b226a3534e02eca6e545e2ba

See more details on using hashes here.

Supported by

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