bind:enable_logging
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
bind:enable_logging [2016/10/16 13:12] – peter | bind:enable_logging [2019/11/26 21:06] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Bind - Enable Logging ====== | ||
- | |||
- | The **rndc** command controls the operation of a name server. | ||
- | |||
- | rndc communicates with the name server over a TCP connection, sending commands authenticated with digital signatures. In the current versions of rndc and bind the only supported authentication algorithm is HMAC-MD5, which uses a shared secret on each end of the connection. This provides TSIG-style authentication for the command request and the name server' | ||
- | |||
- | |||
- | ===== Turn on logging ===== | ||
- | |||
- | Type the following command as root to toggle query logging: | ||
- | |||
- | <code bash> | ||
- | rndc querylog | ||
- | </ | ||
- | |||
- | ===== View bind sever query log ===== | ||
- | |||
- | Once this is done, you can view all logged queries usimg / | ||
- | |||
- | <code bash> | ||
- | tail -f / | ||
- | </ | ||
- | |||
- | You might need to tail / | ||
- | |||
- | ===== Turn off logging ===== | ||
- | |||
- | Type the following command as root to toggle query logging: | ||
- | |||
- | <code bash> | ||
- | rndc querylog | ||
- | </ | ||
- | |||
- | |||
- | **NOTE**: | ||
- | |||
- | <code bash> | ||
- | vi / | ||
- | </ | ||
- | |||
- | Create the logging master file. | ||
- | |||
- | <code bash> | ||
- | vi / | ||
- | </ | ||
- | |||
- | and populate as: | ||
- | |||
- | <file bash / | ||
- | logging { | ||
- | channel default_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel general_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel database_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel security_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel config_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel resolver_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel xfer-in_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel xfer-out_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel notify_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel client_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel unmatched_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel queries_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel network_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel update_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel dispatch_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel dnssec_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | channel lame-servers_file { | ||
- | file "/ | ||
- | severity dynamic; | ||
- | print-time yes; | ||
- | }; | ||
- | |||
- | category default { default_file; | ||
- | category general { general_file; | ||
- | category database { database_file; | ||
- | category security { security_file; | ||
- | category config { config_file; | ||
- | category resolver { resolver_file; | ||
- | category xfer-in { xfer-in_file; | ||
- | category xfer-out { xfer-out_file; | ||
- | category notify { notify_file; | ||
- | category client { client_file; | ||
- | category unmatched { unmatched_file; | ||
- | category queries { queries_file; | ||
- | category network { network_file; | ||
- | category update { update_file; | ||
- | category dispatch { dispatch_file; | ||
- | category dnssec { dnssec_file; | ||
- | category lame-servers { lame-servers_file; | ||
- | }; | ||
- | </ | ||
- | |||
- | |||
- | Make the logging master file accessible to bind: | ||
- | |||
- | <code bash> | ||
- | chown root.bind / | ||
- | </ | ||
- | |||
- | and set the permissions on the file: | ||
- | |||
- | <code bash> | ||
- | chmod 640 / | ||
- | </ | ||
- | |||
- | Add the logging master file into the bind config. | ||
- | |||
- | <code bash> | ||
- | vi / | ||
- | </ | ||
- | |||
- | and modify as: | ||
- | |||
- | <file bash / | ||
- | include "/ | ||
- | include "/ | ||
- | include "/ | ||
- | </ | ||
- | |||
- | |||
- | It is advisable to create the log files manually: | ||
- | |||
- | <code bash> | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | touch / | ||
- | </ | ||
- | |||
- | Make the files accessible to bind: | ||
- | |||
- | <code bash> | ||
- | chown bind.bind / | ||
- | </ | ||
- | |||
- | Make the log files writeable: | ||
- | |||
- | <code bash> | ||
- | chmod 600 / | ||
- | </ | ||
- | |||
- | |||
- | Restart bind server to apply changes | ||
- | |||
- | <code bash> | ||
- | systemctl restart bind.service | ||
- | </ | ||
- | |||
- | |||
- | Check that bind is running okay | ||
- | |||
- | <code bash> | ||
- | systemctl status bind.service | ||
- | </ | ||
bind/enable_logging.1476623530.txt.gz · Last modified: 2020/07/15 09:30 (external edit)