4.7 Logging queries
If MyDNS is started with the
) option, each
query the server receives will be output via the logging mechanism specified
in your configuration file (see section B.4 Miscellaneous configuration options.
Each log line consists of the program name (and possibly the PID) followed by a colon,
then seventeen fields separated by spaces. For example:
mydns: 25-Jul-2003 01:50:11+659583 #1 3987 UDP 192.168.1.1 IN ANY
bboy.net. NOERROR - 1 11 0 5 LOG Y
mydns: 25-Jul-2003 01:50:44+720684 #2 33848 UDP 192.168.1.1 IN ANY
bogus.example.com. NXDOMAIN No_matching_resource_records 1 0 1 0 LOG N
In order, here's what these fields mean:
The date the query was received.
The time the query was received, then a plus sign (`+'), then the number
of microseconds after the second the query was received.
A pound sign (`#') followed by the server's internal ID number for this
query. The internal ID numbers begin at 0 and advance sequentially.
The query ID provided by the client. This is usually a seemingly-random 16-bit
number used by the client to make sure the answer it receives matches the question
The transport used, always either
The client IP address, in dotted-decimal notation.
The query class, always
The query type, such as
NS, etc. (see section 3.3 Supported RR types).
The name being requested.
The result of the query. The following values are possible:
- No error; the query was successful.
- The server was unable to interpret the query.
- MyDNS experienced an internal error, usually the result of some malformed data in the database.
- No resource records (of any type) exist matching the domain name requested.
- The requested type of query is not implemented.
- The query was refused due to server policy. This usually happens because the client attempted
AXFR a zone that they were not allowed to transfer, or because the client requested
a name within a zone for which the server is not authoritative.
If the previous field was anything but
NOERROR, this is a human-readable reason
why the query failed, with any space characters in the string converted into underscore (`_')
characters. If the previous field was
NOERROR, this field contains a dash (`-').
The number of resource records included in the question section of the reply.
The number of resource records included in the answer section of the reply.
The number of resource records included in the authority section of the reply.
The number of resource records included in the additional section of the reply.
The character `Y' if this was a cached reply, `N' if it was not.
There is a script in the
contrib/ directory of the source distribution called
stats.php that provides an example of how a script might read and parse these lines,
in case you wanted to accumulate usage information or something.