Skip to content
🔬 A Prometheus-style metrics exporter for the Dnsmasq DNS forwarder
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rootfs/etc
Dockerfile.glibc
Dockerfile.musl
LICENSE
README.md
dnsmasq_exporter.go

README.md

dnsmasq_exporter

A Prometheus-style metrics exporter for the Dnsmasq DNS forwarder

Note: requires Dnsmasq version 2.69 or above!

Building

Prerequisites

Building

go build dnsmasq_exporter.go

If successful, you'll find your dnsmasq_exporter binary on your working directory.

Configuring

All configuration is done through environment variables:

  • DNSMASQ_SERVERS: (default: 127.0.0.1:53) comma-separated list of the <address>:<port> pairs of the Dnsmasq servers
  • LISTEN_ADDR: (default: 0.0.0.0), bind address for dnsmasq_exporter
  • LISTEN_PORT: (default: 9153), bind port for dnsmasq_exporter

Adding to Prometheus

Add the following to your Prometheus configuration:

scrape_configs:
  - job_name: dnsmasq
    static_configs:
      - targets: ['localhost:9153']

Running

# monitor one server [10.0.0.1:53]
DNSMASQ_SERVERS=10.0.0.1:53 ./dnsmasq_exporter

# monitor many servers [10.0.0.1:53, 192.168.1.1:53]
DNSMASQ_SERVERS=10.0.0.1:53,192.168.1.1:53 ./dnsmasq_exporter

Building (with Docker)

Prerequisites

Building

  • To build the glibc-based image: docker build -t dnsmasq_exporter:glibc -f Dockerfile.glibc .
  • To build the musl-based image: docker build -t dnsmasq_exporter:musl -f Dockerfile.musl .

Official images

Instead of building your own, you can use the official dnsmasq_exporter Docker images.

Docker Hub

Available on Docker Hub as ricardbejarano/dnsmasq_exporter:

Quay

Available on Quay as:

Running

# monitor one server [10.0.0.1:53]
docker run -it -p 9153:9153 -e 'DNSMASQ_SERVERS=10.0.0.1:53' ricardbejarano/dnsmasq_exporter

# monitor many servers [10.0.0.1:53, 192.168.1.1:53]
docker run -it -p 9153:9153 -e 'DNSMASQ_SERVERS=10.0.0.1:53,192.168.1.1:53' ricardbejarano/dnsmasq_exporter

License

See LICENSE.

You can’t perform that action at this time.