CLI Reference (dnsctl)
dnsctl is the command-line client for homeDNS. It communicates with the dnsd management API at /api/v1 (default: http://127.0.0.1:8080).
./bin/dnsctl [--server <url>] <command> [subcommand] [flags]All commands use the HTTP client in cmd/dnsctl/internal/cli/client.go.
Manage authoritative DNS zones.
# List all zonesdnsctl zones list
# Create a new zonednsctl zones create example.com
# Delete a zonednsctl zones delete example.com
# Export zone as RFC 1035 zone file (stdout)dnsctl zones export example.comrecords
Section titled “records”Manage individual resource records within a zone. Records are specified in zone-file presentation format.
# List all records in a zonednsctl records list example.com
# Add a recorddnsctl records add example.com 'www.example.com. 300 IN A 192.0.2.1'dnsctl records add example.com 'mail.example.com. 300 IN MX 10 mail.example.com.'dnsctl records add example.com 'example.com. 300 IN TXT "v=spf1 -all"'
# Delete a record (zone-file format)dnsctl records delete example.com 'www.example.com. 300 IN A 192.0.2.1'Supported record types: A, AAAA, CNAME, MX, TXT, SRV, NS, SOA, PTR, CAA.
forwarders
Section titled “forwarders”Manage conditional forwarders.
# List all forwardersdnsctl forwarders list
# Add a conditional forwarderdnsctl forwarders add \ --id corp-internal \ --zone corp.internal \ --upstream 10.0.0.53:53 \ --strategy parallel
# Delete a forwarderdnsctl forwarders delete corp-internalStrategy options: failover, round_robin, random, parallel, hedged.
filter
Section titled “filter”Manage DNS blocklist/allowlist sources and policy.
# Add a filter sourcednsctl filter add \ --name stevenblack \ --url https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts \ --format 1
# List sourcesdnsctl filter list
# Force refresh all sourcesdnsctl filter refresh
# Force refresh a specific sourcednsctl filter refresh --id stevenblack
# Test a domain name against the current filter statednsctl filter test ads.doubleclick.netdnsctl filter test allowed-domain.comFormat values: 1 = hosts, 2 = domain-only, 3 = AdBlock, 4 = dnsmasq, 0 = auto-detect.
Inspect and control the response cache.
# Show cache statisticsdnsctl cache stats
# Flush the entire cachednsctl cache flushhealth
Section titled “health”Snapshot the current health status of all configured forwarders.
dnsctl healthOutput shows each upstream’s status (healthy / slow / failing), current RTT average, and last-checked timestamp.
query log
Section titled “query log”Tail or retrieve the recent DNS query log.
# Show recent queriesdnsctl query log
# Live tail (SSE stream)dnsctl query log --followManage TSIG keys for DDNS authentication.
# Add a TSIG keydnsctl tsig add \ --name dhcp-update. \ --alg sha256 \ --secret "$(openssl rand -base64 32)"
# List TSIG keysdnsctl tsig list
# Delete a TSIG keydnsctl tsig delete dhcp-update.policy
Section titled “policy”Manage per-zone DDNS update policies.
# Set policy (IP ACL mode)dnsctl policy set \ --zone example.com \ --mode ip_acl \ --cidrs 10.0.0.0/24,127.0.0.0/8
# Set policy (TSIG mode)dnsctl policy set \ --zone example.com \ --mode tsig_required \ --keys dhcp-update.
# Get current policy for a zonednsctl policy get example.comModes: none, ip_acl, tsig_required, tsig_optional.
Launch the full-screen interactive TUI. Provides the same operations as the web admin in a terminal-native interface.
dnsctl tui
# Beta TUI (if available in your build)dnsctl tui-betaNavigate with arrow keys; press ? for help within the TUI.