You know the Spiel: you’re looking at a logfile containing BIND’s querylog output, and you think: what do those flags really mean? Here are two sample logfile entries, the first from a BIND version in 2011 (when I originally wrote this piece), and the second from a BIND version 9.11.2 server.

client view authoritative: query: IN NS -EDC (
client @0x7fa0d607f200 ( view internal: query: query: IN NS +E(0)K (

Note how the format of the log lines has changed. I pity you if you’re using regular expressions to handle these entries … :)

As usual, the best documentation is the source code. I extracted this snippet from bin/named/query.c for your pleasure. (This is from named 9.11.2.)

              level, "query: %s %s %s %s%s%s%s%s%s%s (%s)", namebuf,
              classname, typename, WANTRECURSION(client) ? "+" : "-",
              (client->signer != NULL) ? "S" : "", ednsbuf,
              TCP(client) ? "T" : "",
              ((extflags & DNS_MESSAGEEXTFLAG_DO) != 0) ? "D" : "",
              ((flags & DNS_MESSAGEFLAG_CD) != 0) ? "C" : "",
              HAVECOOKIE(client) ? "V" : WANTCOOKIE(client) ? "K" : "",

It starts off with a pointer address followed by the client’s IP and port and the name. The view used is shown here ("internal") followed by the string "query". Then come the name that was queried, the class (IN) and type (NS), and some flags which indicate whether recursion was requested (+) or not (-), if the request was signed (S), whether EDNS0 was enabled (E) with its flags, and whether the connection was over TCP (T) or UDP (the default which is not specified).

If DNSSEC was requested we see a (D), and if the CD (checking disabled) flag was in use a (C).

[Flags missing means they weren’t set.] And last, in parenthesis, the client’s destination address (i.e. the address of the name server).

DNS, BIND, and named :: 22 Feb 2011 :: e-mail