Книга: Fedora™ Unleashed, 2008 edition
Logging
Logging
The example now has all the elements of a minimal functioning DNS server, but before experimenting further, some extra logging will allow you to see exactly what named
is doing. Log options are configured in a logging section in named.conf
, and the various options are described in detail in the BIND 9 ARM.
All log messages go to one or more channels — each of which can write messages to the syslog
, to an ordinary file, stderr
, or null
. (Log messages written to null
are discarded.) Categories of messages exist, such as those generated while parsing configuration files, those caused by OS errors, and so on. Your logging statement must define some channels and associate them with the categories of messages that you want to see.
BIND logging is very flexible, but complicated, so we examine only a simple log configuration here. The following addition to named.conf
sets up a channel called custom
, which writes time-stamped messages to a file and sends messages in the listed categories to it:
----------
| logging {
| channel custom {
| file "/tmp/named.log"; # Where to send messages.
| print-time yes; # Print timestamps?
| print-category yes; # Print message category?
| };
| category config { custom; }; # Configuration files
| category notify { custom; }; # NOTIFY messages
| category dnssec { custom; }; # TSIG messages
| category general { custom; }; # Miscellaneous
| category security { custom; }; # Security messages
| category xfer-out { custom; }; # Zone transfers
| category lame-servers { custom; };
| };
----------
NOTE
Retaining and frequently examining your logs is especially important because syntax errors often cause BIND to reject a zone and not answer queries for it, causing your server to become lame (meaning that it is not authoritative for the zone for which it is supposed to be).
- Logging In and Shutting Down
- Logging In to and Working with Linux
- Logging Out
- Logging In and Out from a Remote Computer
- Configure System Logging
- Enabling and disabling event logging
- Using debug logging to track DNS activity
- HTML Logging
- Chapter 6. Traversing of tables and chains
- Chapter 8. Saving and restoring large rule-sets
- Chapter 11. Iptables targets and jumps
- 1.2.2 ROM