Книга: 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).

Оглавление книги


Генерация: 2.903. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз