Monitor Bind9 DNS with Prometheus bind_exporter

by Daniel Pham
Published: Updated:
This entry is part 14 of 14 in the series Install Prometheus and Grafana on Ubuntu 18

In this article, I will guide you to monitor Bind9 DNS with Prometheus bind_exporter.

On Linux, you probably already know and are familiar with the dns bind9 service. Normally, companies and data centers will have an internal DNS system.

And as a service provided to the entire system, you also need to monitor it. My demo system uses Ubuntu server 18.04 LTS.

Install bind_exporter

Installing bind_exporter on Ubuntu 18.04 is quite simple. Ubuntu already supports the installation package, which is built from the Digital Ocean repository.

The steps below, you can do it on DNS servers.

First, you need to create a user system named prometheus. Because the bind_exporter service will use this user.

groupadd --system prometheus
grep prometheus /etc/group
useradd -s /sbin/nologin -r -g prometheus prometheus

Next, type the command below to install the exporter.

apt install prometheus-bind-exporter -y

In order for the exporter to collect information from the bind9 dns service, you need to set up the following. Open the local config file.

nano /etc/bind/named.conf.local

Add the content below at the end of the file.

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

You then reload the bind9 service and start the bind exporter service.

service bind9 reload
service prometheus-bind-exporter restart

At this point, the installation is complete.

Set up Prometheus for bind_exporter

Now, you log in to the Prometheus server, set up bind_exporter.

nano /etc/promtheus/prometheus.yml

Copy the content below to the end of the file. Please replace the server IP in the content below with your actual server IP/hostname.

  - job_name: 'bind_exporter'
    scrape_interval: 15s
    metrics_path: '/metrics'
    static_configs:
    - targets:
      - ip-server-dns01:9119
      - ip-server-dns02:9119

Please note that you need to open port 9119 between the Prometheus server and the DNS servers.

Then you reload the Prometheus service.

systemctl reload prometheus

Set up the Grafana dashboard for Bind9 DNS

In bind_exporter’s github readme, the Grafana dashboard is also mentioned with ID 12309.

This dashboard is quite complete and works for this exporter. So you can safely import it without any errors.

Monitor Bind9 DNS with Prometheus bind_exporter
Monitor bind9 DNS with Prometheus bind_exporter.

Conclusion

So I have guided you through the installation and setup of monitor bind9 DNS with Prometheus bind_exporter. The result you get is an intuitive interface as shown above.

0 0 votes
Article Rating
Series Navigation«« Previous part: Monitor VMware with Prometheus vmware_exporter

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.