In our previous article, we told you to how to setup DNS server using BIND on your linux machines. Enabling DNS server logging is a good practice, which will allow you to keep track of DNS queries and more importantly for troubleshooting DNS problems. DNS logging can be enabled using ‘rndc’ command; which controls the operation of your nameserver. ‘rndc’ comes as a replacement of ndc tools that use to come along with older versions of BIND.
Ok! To turn on the name server logging, run the below command as root user.
$ rndc querylog
How to view the DNS query logs?
Type the below command,
tailf /var/log/messages
How to Turn Off DNS server logging?
The below command will toggle server logging.
$ rndc querylog
Checkout other articles related to DNS
What is DNS and the difference between Authoritative and Recursive DNS? – TG Explains