BIND9 DNS engine was installed on Ubuntu server, the goal is to measure the QPS by enabling the statistics.
Installing the BIND9 command: sudo apt install bind9 bind9utils bind9-doc bind9-host
Locate the named.stats file on your server using the following command:
locate named.stats , the file was in : “/var/cache/bind/named.stats”, add the following command to named.config.options which can be found in: /etc/bind/named.conf.options, open the file using nano command.
listen-on port 53 { any; };
allow-query { any ; // or localhost; 192.168.1.0/24;};
forwarders { 8.8.8.8; };
recursion yes;
listen-on-v6 { any; };
statistics-file “/var/cache/bind/named.stats”;
Enable rndc command, using rndc-config, add the following configurations to named.config which can be found in the following directory: /etc/bind/named.conf.
include “/etc/bind/rndc.key”;
controls {
inet 127.0.0.1 allow {
localhost; } keys { “rndc-key”;
};
};
run the command Rndc stats, and then open the output using: cat /var/cache/bind/named.stats.
using the output you can calculate the number of queries the server received during specific time.