Containerized BIND DNS Server with Smart Management
Optional Chief plugin that lets you control a remote BindCaptain installation from your local machine. All DNS and service commands are executed on the remote host over SSH.
Use case: BindCaptain runs on a server (e.g. wolfman.homelab.io); you use Chief on your laptop and run bc.create, bc.list, etc.; the plugin runs the corresponding commands on the server via SSH.
Chief is a separate project. If you are not familiar with it, see the Chief GitHub project for what it is, how to install it, and how to use plugins:
https://github.com/randyoyarzabal/chief
bc (BindCaptain)chief-plugin/bc_chief-plugin.sh| Requirement | Details |
|---|---|
| Chief | Separate shell framework that loads user plugins. See Chief on GitHub for more info. |
| SSH | Access to the remote host as a user that can run sudo (typically root). |
| Remote host | BindCaptain installed (e.g. under /opt/bindcaptain) with tools/bindcaptain_manager.sh and, if you use service commands, the systemd unit bindcaptain. |
| SSH auth | Key-based authentication is recommended so commands run without a password prompt. |
Set these before sourcing the plugin, or edit the defaults inside bc_chief-plugin.sh.
| Variable | Description | Default |
|---|---|---|
BC_HOST |
SSH target: user@host. Must be able to sudo on the remote. |
root@wolfman.homelab.io |
BC_MANAGER |
Absolute path to bindcaptain_manager.sh on the remote host. |
/opt/bindcaptain/tools/bindcaptain_manager.sh |
export BC_HOST="root@dns.example.com"
export BC_MANAGER="/opt/bindcaptain/tools/bindcaptain_manager.sh"
# Then load the plugin (e.g. Chief does this automatically for the bc plugin)
source /path/to/bc_chief-plugin.sh
bc plugin. The exact path depends on your Chief setup (e.g. chief_plugins/user_plugins/bc_chief-plugin.sh or equivalent). You can copy from the BindCaptain repo:
cp bindcaptain/chief-plugin/bc_chief-plugin.sh /path/to/chief/user_plugins/
BC_HOST and BC_MANAGER for your BindCaptain server (see above).chief.plugin bc if your Chief supports it).bc.help to confirm and see usage.After loading the plugin:
| Command | Description |
|---|---|
bc.create <fqdn> <ip> |
Create A record (and PTR when applicable). |
bc.create_cname <fqdn> <target> |
Create CNAME record. |
bc.create_txt <name> <domain> <value> |
Create TXT record. |
bc.delete <fqdn> [type] |
Delete a DNS record. |
bc.list [domain] |
List records (all zones or one domain). |
bc.refresh |
Validate and reload BIND on the remote. |
bc.git_refresh |
Run git pull in the BindCaptain repo on the remote. |
bc.status |
Show BindCaptain service and container status. |
bc.start / bc.stop / bc.restart |
Control the BindCaptain systemd service. |
bc.ssh |
Open an interactive SSH session to the BindCaptain host. |
bc.help |
Show full usage and current BC_HOST / BC_MANAGER. |
# Create A record
bc.create webserver.homelab.io 172.25.50.100
# Create CNAME
bc.create_cname www.homelab.io webserver
# TXT record
bc.create_txt @ homelab.io "v=spf1 -all"
# List records
bc.list homelab.io
# Delete record
bc.delete webserver.homelab.io
# Refresh BIND config on remote
bc.refresh
# Update BindCaptain from Git on remote
bc.git_refresh
# SSH to the BindCaptain host
bc.ssh
./bc_chief-plugin.sh).bc.* command uses ssh $BC_HOST to run the corresponding operation on the remote host.source $BC_MANAGER && bc.create_record ... (and similar) on the remote, so the same logic as bindcaptain_manager.sh is used there.systemctl and podman on the remote.“Cannot connect to $BC_HOST”
Check SSH from your machine: ssh $BC_HOST. Ensure key-based auth or agent is set up so the plugin can connect without a password.
“Permission denied” or sudo errors on remote
The user in BC_HOST must be able to run sudo without a password for the paths and commands the plugin uses (e.g. sudo source $BC_MANAGER, sudo systemctl, sudo podman).
Manager not found on remote
Confirm BindCaptain is installed and BC_MANAGER points to the real path on the remote host (e.g. /opt/bindcaptain/tools/bindcaptain_manager.sh). See Installation for where BindCaptain lives on the server.
bc.*-style commands when run on the server (sourcing bindcaptain_manager.sh).