< >   << Up >>         TopContentsIndex ?

4.7 Logging queries

If MyDNS is started with the --verbose (-v) 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 IN ANY
	bboy.net. NOERROR - 1 11 0 5 LOG Y


mydns: 25-Jul-2003 01:50:44+720684 #2 33848 UDP IN ANY
	bogus.example.com. NXDOMAIN No_matching_resource_records 1 0 1 0 LOG N

In order, here's what these fields mean:

  1. The date the query was received.

  2. The time the query was received, then a plus sign (`+'), then the number of microseconds after the second the query was received.

  3. A pound sign (`#') followed by the server's internal ID number for this query. The internal ID numbers begin at 0 and advance sequentially.

  4. 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 it asked.

  5. The transport used, always either TCP or UDP.

  6. The client IP address, in dotted-decimal notation.

  7. The query class, always IN.

  8. The query type, such as A, MX, NS, etc. (see section 3.3 Supported RR types).

  9. The name being requested.

  10. 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 to 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.

  11. 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 (`-').

  12. The number of resource records included in the question section of the reply.

  13. The number of resource records included in the answer section of the reply.

  14. The number of resource records included in the authority section of the reply.

  15. The number of resource records included in the additional section of the reply.

  16. The word LOG.

  17. 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.

< >   << Up >>         TopContentsIndex ?