Ubuntu Server Guide Changes, errors and bugs
Note The Serial Number of your zone file will probably be different. Quick temporary query logging
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
Note
The Serial Number of your zone file will probably be different. Quick temporary query logging With the rndc tool, you can quickly turn query logging on and off, without restarting the service or changing the configuration file. To turn query logging on, run: sudo rndc q u e r y l o g on Likewise, to turn it off, run: sudo rndc q u e r y l o g o f f The logs will be sent to syslog and will show up in /var/log/syslog by default: Jan 20 1 9 : 4 0 : 5 0 new−n1 named [ 8 1 6 ] : r e c e i v e d c o n t r o l c h a n n e l command ’ q u e r y l o g on ’ Jan 20 1 9 : 4 0 : 5 0 new−n1 named [ 8 1 6 ] : query l o g g i n g i s now on Jan 20 1 9 : 4 0 : 5 7 new−n1 named [ 8 1 6 ] : c l i e n t @0x7f48ec101480 1 9 2 . 1 6 8 . 1 . 1 0 # 3 6 1 3 9 ( ubuntu . com ) : query : ubuntu . com IN A +E( 0 )K ( 1 9 2 . 1 6 8 . 1 . 1 0 ) Note The amount of logs generated by enabling querylog could be huge! 159 Logging BIND9 has a wide variety of logging configuration options available, but the two main ones are channel and category, which configure where logs go, and what information gets logged, respectively. If no logging options are configured the default configuration is: l o g g i n g { c a t e g o r y d e f a u l t { d e f a u l t _ s y s l o g ; de f a u l t _ d e b u g ; } ; c a t e g o r y unmatched { n u l l ; } ; } ; Let’s instead configure BIND9 to send debug messages related to DNS queries to a separate file. We need to configure a channel to specify which file to send the messages to, and a category. In this example, the category will log all queries. Edit /etc/bind/named.conf.local and add the following: l o g g i n g { c h a n n e l query . l o g { f i l e ”/ var / l o g /named/ query . l o g ” ; s e v e r i t y debug 3 ; } ; c a t e g o r y q u e r i e s { query . l o g ; } ; } ; Note The debug option can be set from 1 to 3. If a level isn’t specified, level 1 is the default. • Since the named daemon runs as the bind user the /var/log/named directory must be created and the ownership changed: sudo mkdir / var / l o g /named sudo chown bind : bind / var / l o g /named • Now restart BIND9 for the changes to take effect: sudo s y s t e m c t l r e s t a r t bind9 . s e r v i c e You should see the file /var/log/named/query.log fill with query information. This is a simple example of the BIND9 logging options. For coverage of advanced options see More Information. Download 1.27 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling