Turn on DNS Query Log on Bind

You are running a recursive DNS server and would like to find out the statistic of your user browser behavior (Whether they browse Facebook or Google?). Turn on DNS query logs will allow you to find out the statistic. To turn on DNS query log in Bind, configure lines below on named.conf

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

logging{

channelquery_logging{

file"/var/log/query.log"versions3size10m;

severity debug3;

print-time yes;

print-severity yes;

print-category yes;

};

categoryqueries{

query_logging;

};

};

To turn on query logging while DNS service is running; you need to to rndc querylog and check the status with rndc status