Skip to content
BleemeoBleemeo

BIND

Auto-Detection
Built-in Metrics

BIND is the most widely used open-source Domain Name System software on the internet

Bleemeo monitors the BIND DNS server through automatic service detection by process, a service check on port 53, and built-in metrics from port 8053 by default. If the auto-detected parameters are incorrect, you can override them manually — stats_port is the statistics channel’s port.

Terminal window
sudo tee /etc/glouton/conf.d/99-bind.conf > /dev/null << 'EOF'
service:
# For a BIND running outside a container
- type: "bind"
address: "127.0.0.1"
port: 53
stats_port: 8053
# For a BIND running in a Docker container
- type: "bind"
instance: "CONTAINER_NAME"
port: 53
stats_port: 8053
EOF

Glouton automatically detects configuration changes.

The statistics channel must be enabled. It is disabled by default, and without it BIND exposes no counter at all: the service is detected and checked, but reports no metrics. Add the block to /etc/bind/named.conf (or /etc/named.conf):

statistics-channels {
inet 127.0.0.1 port 8053 allow { 127.0.0.1; };
};

For a BIND in a container, bind the channel to an address the agent can reach and allow its network:

statistics-channels {
inet 0.0.0.0 port 8053 allow { 172.17.0.0/16; };
};

Reload BIND after the change (rndc reload).

Glouton defaults to reading statistics at /xml/v3, but older BIND versions expose statistics on a different path. Glouton supports all of them but you need to configure stats_url with the full path for them:

BIND version stats_url
9.10 and later http://127.0.0.1:8053/xml/v3 (Glouton’s default)
9.10 and later, reading JSON instead http://127.0.0.1:8053/json/v1
9.9 http://127.0.0.1:8053/xml/v2
9.6 – 9.8 http://127.0.0.1:8053 — no path at all
MetricDescription
service_statusStatus of BIND
bind_counter_queryNumber of BIND queries received, per second
bind_counter_responseNumber of BIND queries answered, per second
bind_counter_qry_successNumber of BIND queries successfully answered, per second
bind_counter_qryfailureNumber of BIND queries answered with an error other than NXDOMAIN or SERVFAIL, per second
bind_counter_nxdomainNumber of BIND responses with an NXDOMAIN status, per second
bind_counter_servfailNumber of BIND responses with a SERVFAIL status, per second
bind_counter_refusedNumber of BIND queries refused by the ACLs, per second
bind_counter_recqryrejNumber of BIND recursive queries rejected, per second
bind_memory_in_useBIND memory in use

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

The check only opens the DNS port over TCP so it fails when nothing listens there (Connection refused), when a firewall drops the packets (connection timed out after 10 seconds), or when the configured address cannot be parsed (Invalid TCP address). A green check proves the port is open, and nothing more: it says nothing about the statistics channel.

Reproduce what Glouton does, from the machine where the agent runs. Glouton does not read the configured path itself: it asks for three documents below it — /server, /net and /mem — so query the first one, and keep the response headers:

Terminal window
curl -si http://127.0.0.1:8053/xml/v3/server | head -3
What you see Cause Fix
Connection refused The statistics channel is not enabled Add the statistics-channels block and reload BIND
Connection refused The channel is on another port Set stats_port to match
Empty reply from server The channel’s allow list does not cover the agent. BIND accepts the connection, then closes it without sending anything — it never answers 403 Add the agent’s address to it
HTTP/1.1 404 No such URL This BIND predates 9.10 and serves no XML v3 at all. An older server answers 404 for a path it does not know; it never returns a document in an older format Set stats_url to the path for that version — see the table above
HTTP/1.1 200 OK and XML, but still no metrics The agent is not reaching the same endpoint (a container without access to the host’s 127.0.0.1, or a firewall) Bind the channel to an address the agent can reach and allow its network