Home > Enterprise >  what does "QUERY" mean in the reponse of dig?
what does "QUERY" mean in the reponse of dig?

Time:12-21

dig qq.com

; <<>> DiG 9.10.6 <<>> qq.com
;; global options:  cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61180
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;qq.com.                IN  A

;; ANSWER SECTION:
qq.com.         95  IN  A   183.3.226.35
qq.com.         95  IN  A   203.205.254.157
qq.com.         95  IN  A   123.151.137.18
qq.com.         95  IN  A   61.129.7.47

;; Query time: 59 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Dec 21 00:16:17 CST 2021
;; MSG SIZE  rcvd: 99

in my example,the QUERY is 1.
I come from here
Query: 1: The number of queries in this session, which was one.
Is the explanation right?
If if it is right,can I have more queries at once,I saw all of examples in internet is always 1.

from https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1
QDCOUNT an unsigned 16 bit integer specifying the number of entries in the question section
from https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.2
The question section is used to carry the "question" in most queries, i.e., the parameters that define what is being asked. The section contains QDCOUNT (usually 1) entries

CodePudding user response:

Query: 1: The number of queries in this session, which was one. Is the explanation right?

Yes, dig displays there the number of entries for the 4 sections: QUERY, ANSWER, AUTHORITY, ADDITIONAL.

If if it is right,can I have more queries at once,I saw all of examples in internet is always 1.

You can't.

The format seems to allow for it, however things were never really specified so it is not possible today, for at least the simple reason that the answer has a single return code to note the success or failure of the request, so if the request has multiple queries, some successul, some not, how could the return code handle that?

CodePudding user response:

I believe that is answered here: https://www.ietf.org/rfc/rfc1035.txt

OPCODE A four bit field that specifies kind of query in this message. This value is set by the originator of a query and copied into the response. The values are:

            0               a standard query (QUERY)

            1               an inverse query (IQUERY)

            2               a server status request (STATUS)

            3-15            reserved for future use

In the case of dig, I supposed we will either see QUERY or IQUERY as we are either retrieving the domain name that corresponds to Internet address or vice versa

  • Related