bind9

by unxwares-sac

Helm chartv2026.11.5App 9.20.30MITVerified publisher

A flexible and production-ready Helm chart for running ISC Bind9 DNS server on Kubernetes.

About this chart

Bind9 Helm Chart

ISC BIND 9 is the reference implementation of the DNS protocol: it serves as an authoritative server, a recursive resolver or both. This chart runs named as a Deployment, configured with your own named.conf and zone files, from a BIND image built by UnxWares from the signed ISC release (ghcr.io/unxwares/bind9) or from the official internetsystemsconsortium/bind9 image, with an optional Prometheus exporter (bind_exporter, built by UnxWares by default). The chart is maintained by UnxWares.

Features

  • Authoritative or recursive DNS, configured with your own named.conf (bind.namedConf) and zone files (bind.zones). The default configuration is authoritative only: no recursion, no zone transfers, version hidden.
  • named from ghcr.io/unxwares/bind9 by default: BIND built from the ISC release tarball (SHA-256 and OpenPGP signature checked) with the build options, paths and user of the official image, rebuilt twice a week on current Alpine packages, for amd64 and arm64. The official ISC image stays available (imageProvider: upstream).
  • Hardened: named runs as the bind user (uid 53) from the start, without any capability; the pods meet the restricted Pod Security Standard. Read-only root filesystem, seccomp RuntimeDefault, no service account token.
  • Pods restart on their own when named.conf or a zone file changes (checksum annotation).
  • Optional persistence for /var/lib/bind (dynamic zones, journals, secondary zones, DNSSEC keys).
  • Prometheus metrics through a bind_exporter sidecar and an optional ServiceMonitor.
  • ClusterIP, NodePort or LoadBalancer DNS Service; the metrics and rndc ports are on a separate admin Service, so publishing DNS never publishes them.
  • PodDisruptionBudget, NetworkPolicy, topology spread constraints and HorizontalPodAutoscaler.
  • helm test checks that the server answers over UDP and TCP; an end-to-end test in CI checks the answers of the zones, the metrics and the NetworkPolicy (see Testing).

Architecture

With a release named my-dns, the resources are called my-dns-bind9 (or just the release name when it already contains bind9). This is <fullname> below.

ResourceNameCreated whenContent
Deployment<fullname>alwayscontainer bind9 (named), plus container bind9-exporter with metrics.enabled; no init container
ConfigMap<fullname>-configalwaysnamed.conf (bind.namedConf, preceded by a statistics-channels block with metrics.enabled) and one <key>.zone per entry of bind.zones
Service<fullname>service.enabled (default)dns-tcp and dns-udp on 53, nothing else
Service<fullname>-adminmetrics.enabled or service.exposeRndcmetrics on 9119 with metrics.enabled, rndc on 953 with service.exposeRndc; type adminService.type (ClusterIP)
PersistentVolumeClaim<fullname>-pvcpersistence.enabled without persistence.existingClaim/var/lib/bind, annotated helm.sh/resource-policy: keep
ServiceAccount<fullname>serviceAccount.create (default)token not mounted
HorizontalPodAutoscaler<fullname>autoscaling.enabledCPU target autoscaling.targetCPUUtilizationPercentage, memory target autoscaling.targetMemoryUtilizationPercentage when set
PodDisruptionBudget<fullname>podDisruptionBudget.enabledminAvailable, or maxUnavailable when set
NetworkPolicy<fullname>networkPolicy.enabledingress: DNS open, rndc and metrics from networkPolicy.adminAllowedFrom only
ServiceMonitor<fullname>metrics.enabled, metrics.serviceMonitor.enabled and the monitoring.coreos.com/v1 CRDscrapes the metrics port of the admin Service
Pod (helm test)<fullname>-test-dnsservice.enabledsee Testing

The chart creates no Secret. Volumes of the bind9 container:

MountVolumePurpose
/etc/bind/named.conf, /etc/bind/<key>.zonethe ConfigMap (read-only)configuration and static zones
/var/lib/bindthe PVC with persistence.enabled, otherwise an emptyDir (persistence.emptyDirSizeLimit)files named writes: dynamic zones, journals, secondary zones, keys
/var/cache/bindemptyDir, 64Minamed's working directory (directory option): managed keys, dumps
/run/namedemptyDir, 1Mipid file
/tmpemptyDir, 16Mitemporary files

The exporter reads named's statistics channel on 127.0.0.1:8053 inside the pod and serves Prometheus metrics on service.ports.metrics (9119), reached through the admin Service.

Images

ContainerimageProvider: unxwares (default)imageProvider: upstreamValues
bind9 (and the helm test pod)ghcr.io/unxwares/bind9:9.20.30docker.io/internetsystemsconsortium/bind9:9.20image.repository, image.tag, image.digest
bind9-exporter (metrics.enabled)ghcr.io/unxwares/bind-exporter:0.8.0-62-gbafd56fdocker.io/prometheuscommunity/bind-exporter:master@sha256:a1f46e6abf8d284a158a1ba0e3275bc2e17f9119ec227f18bdb20019d24b3bcfmetrics.image.repository, metrics.image.tag, metrics.image.digest

imageProvider selects both images; image.repository or metrics.image.repository replaces one of them (a mirror, your own build). An empty image.tag follows the image: the chart appVersion (9.20.30, the BIND release) for the UnxWares image, its branch (9.20) for the ISC image (any repository ending in internetsystemsconsortium/bind9).

  • imageProvider: unxwares (default):
    • named: BIND built by UnxWares from the ISC release tarball, checked against its SHA-256 and the OpenPGP signature of an ISC code-signing key. It has the base (Alpine 3.24), the build options (DNS over TLS and HTTPS, GeoIP2, LMDB, GSS-TSIG, dnstap, JSON and XML statistics), the paths (/etc/bind, /var/cache/bind, /var/lib/bind, /run/named), the ports and the user (bind, uid 53) of the official image, so the same named.conf and volumes work with both. ISC rebuilds its image at each BIND release; this one is rebuilt twice a week on the current Alpine packages, and sooner when the CVE watch finds a critical or high vulnerability that a rebuild fixes. It is published for linux/amd64 and linux/arm64, scanned and signed; see images/.
    • exporter: bind_exporter built by UnxWares from its sources, the master branch at commit bafd56f (62 commits after v0.8.0), with Go 1.27 and current golang.org/x modules (proposed upstream in prometheus-community/bind_exporter#301), as a static binary on a distroless base, running as nobody. It is rebuilt twice a week, scanned and signed.
  • imageProvider: upstream:
    • named: the official ISC image. ISC publishes one tag per maintained branch (9.18, 9.20, 9.21) and moves it to each new patch release: 9.20 is the current stable branch, 9.21 the development branch. It is published for linux/amd64 only: the chart then keeps the pods on amd64 nodes (see Scheduling).
    • exporter: the Prometheus community image, its master build of 2026-10-14 pinned by digest. v0.8.0, its latest release (November 2024), was built with an old Go toolchain: set metrics.image.tag: v0.8.0 to use it.

To keep the ISC image for named only, set image.repository: docker.io/internetsystemsconsortium/bind9: the tag and the node selector follow.

To pin an image, set its digest: it takes precedence over the tag. Read the current digest of a tag with:

docker buildx imagetools inspect ghcr.io/unxwares/bind9:9.20.30   # prints "Digest: sha256:..."
imageProvider: upstream
image:
  digest: sha256:66092edb53c081fa11b1fa8219e99065b0f497cb38f568ba789702a4c10e2590   # ISC 9.20 on 2026-10-21

The UnxWares tags also exist per build (9.20.30-<YYYYMMDD>): image.tag set to one of them pins that build.

Known vulnerabilities of the images the charts of this repository can deploy are tracked in the CVE watch issue.

Requirements

Kubernetes: >=1.27.0-0

  • Kubernetes 1.27 to 1.29: supported; the preStop hook (see Shutdown and rolling updates) runs sleep from the image there, and uses the sleep lifecycle action from 1.30, where that action is enabled by default.
  • Node architecture: linux/amd64 or linux/arm64 with the UnxWares image. The ISC image (imageProvider: upstream) has no arm64 build: the chart then keeps the pods on amd64 nodes, so the cluster needs at least one (see Scheduling).
  • Pod sysctl: the pods set net.ipv4.ip_unprivileged_port_start=53, one of the sysctls Kubernetes considers safe (allowed by default, and by the restricted Pod Security Standard). A policy engine that forbids every sysctl rejects the pods: see Security for the alternatives.
  • Storage: only with persistence.enabled: a default StorageClass, persistence.storageClass, or an existing PVC (persistence.existingClaim). ReadWriteOnce is enough for a single replica.
  • Exposure outside the cluster: DNS is UDP and TCP, not HTTP, so there is no Ingress or Gateway API route. Use a LoadBalancer Service (MetalLB, cloud load balancer) that supports UDP and a Service mixing UDP and TCP on the same port, or a NodePort Service.
  • Optional: the Prometheus Operator CRDs for the ServiceMonitor, metrics-server for the HorizontalPodAutoscaler, and a CNI that enforces NetworkPolicies for networkPolicy.enabled.

Installation

helm repo add unxwares https://helm.unxwares.studio
helm repo update
helm install my-dns unxwares/bind9 --namespace dns-system --create-namespace -f my-values.yaml

Charts are signed with the UnxWares Helm Charts OpenPGP key (fingerprint 7902 E52E A435 EF27 C643 2E53 78D6 B532 C599 DA9B, public key https://helm.unxwares.studio/pgp-public-key.asc). To verify the package before installing it:

curl -fsSL https://helm.unxwares.studio/pgp-public-key.asc | gpg --import
gpg --export 7902E52EA435EF27C6432E5378D6B532C599DA9B > ~/.gnupg/unxwares-helm.gpg
helm install my-dns unxwares/bind9 --namespace dns-system --create-namespace -f my-values.yaml \
  --verify --keyring ~/.gnupg/unxwares-helm.gpg

See also verifying signatures.

Without values, named starts with no zone and answers REFUSED to every query. A real install needs at least your zones in bind.namedConf and bind.zones (see the authoritative server example) and, to serve clients outside the cluster, a NodePort or LoadBalancer Service (see Exposure).

After the install, query the server from inside the pod, or through a port-forward (TCP only, hence dig +tcp):

kubectl exec -n dns-system deploy/my-dns-bind9 -c bind9 -- dig @127.0.0.1 www.example.com

kubectl port-forward -n dns-system svc/my-dns-bind9 5353:53
dig +tcp -p 5353 @127.0.0.1 www.example.com

Pods of the cluster reach it at my-dns-bind9.dns-system.svc on port 53.

Configuration

named.conf and zone files

bind.namedConf is the whole named.conf. Each entry of bind.zones becomes the file /etc/bind/<key>.zone (the key must be a valid ConfigMap key: letters, digits, -, _ and .). Reference it from a zone statement:

bind:
  namedConf: |
    options {
      directory "/var/cache/bind";
      listen-on { any; };
      listen-on-v6 { any; };
      recursion no;
      allow-transfer { none; };
      version none;
    };
    zone "example.org" {
      type primary;
      file "/etc/bind/example-org.zone";
    };
  zones:
    example-org: |
      $TTL 3600
      @   IN SOA ns1.example.org. hostmaster.example.org. ( 2026110201 3H 15M 1W 1H )
      @   IN NS  ns1.example.org.
      ns1 IN A   192.0.2.1
      www IN A   192.0.2.10
  • Keep directory "/var/cache/bind";: it is the only writable working directory (the root filesystem is read-only).
  • Keep 127.0.0.1 in listen-on (any includes it): the liveness and readiness probes run dig @127.0.0.1.
  • Files under /etc/bind are read-only. Use bind.zones for static zones. Zones that named writes (dynamic updates, secondary zones, inline signing) need their file, journal and keys under /var/lib/bind, with persistence enabled to keep them across restarts.
  • Any change to named.conf or a zone restarts the pods (rolling update, or Recreate with a ReadWriteOnce volume). Increase the SOA serial when you change a zone that has secondaries.
  • A ConfigMap is limited to 1 MiB: mount large zones from your own ConfigMap or volume (see Extra arguments, volumes and mounts).
  • Logs go to stderr (named -g): do not configure logging channels that write to files, unless you mount a writable volume for them.

Persistence

Without persistence, /var/lib/bind is an emptyDir and its content is lost when the pod is replaced.

persistence:
  enabled: true
  s

Deploy bind9 with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has bind9 on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartbind9 is pinned at v2026.11.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply