What does “Warning: query response not set” mean in dig output

digdomain-name-system

As the title suggests what does "Warning: query response not set" mean. I see the following in the dighost.c (line 2888 and 2889) source but still am uncertain with what in my DNS servers response would cause it.

if (result == ISC_R_SUCCESS && (msgflags & DNS_MESSAGEFLAG_QR) == 0)
    printf(";; Warning: query response not set\n");

Best Answer

The QR bit (the MSB in the 3rd octet in the header) indicates whether the packet is a request (0) or a response (1).

All clients MUST therefore send packets with that bit clear, and the server MUST send it back with that bit set. The error messages tell you that a response was received that was flagged as a request.

BTW, there was a known bug in the Microsoft DNS server some years back where it would answer a packet even if the QR bit was set in that packet! As a result it was possible to cause a packet loop.