我只是对 DNS RFC 中某些变量部分的命名法感到好奇:https://www.ietf.org/rfc/rfc1035.txt
虽然我能够找到大多数其他缩写词:
”在“QDCOUNT”中代表什么?
注意这个字段现在没用了,因为 BIND 一直拒绝 QDCOUNT != 1。每笔交易无法询问多个问题,这不是疏忽,而是因为只有一个 AA 位来描述整个答案部分。
我相信它可能代表查询数据,但我不相信除了询问设计DNS的人之外你会得到官方答案。
The unsigned fields query count (QDCOUNT), answer count (ANCOUNT),
authority count (NSCOUNT), and additional information count (ARCOUNT)
express the number of records in each section for all opcodes except
Update. These fields have the same structure and data type for
Update but are instead the counts for the zone (ZOCOUNT),
prerequisite (PRCOUNT), update (UPCOUNT), and additional information
(ARCOUNT) sections.
其他参考:1
,2 我们也可以直接使用
DNSRR 迭代由于这个问题仍然受到关注,而且我对套接字编程已经非常深入,所以我想我应该从
bind4.8 源代码 添加这段代码
*%
* Structure for query header. The order of the fields is machine- and
* compiler-dependent, depending on the byte/bit order and the layout
* of bit fields. We use bit fields only in int variables, as this
* is all ANSI requires. This requires a somewhat confusing rearrangement.
*/
typedef struct {
unsigned id :16; /*%< query identification number */
#if __BYTE_ORDER == __BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /*%< response flag */
unsigned opcode: 4; /*%< purpose of message */
unsigned aa: 1; /*%< authoritative answer */
unsigned tc: 1; /*%< truncated message */
unsigned rd: 1; /*%< recursion desired */
/* fields in fourth byte */
unsigned ra: 1; /*%< recursion available */
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
unsigned ad: 1; /*%< authentic data from named */
unsigned cd: 1; /*%< checking disabled by resolver */
unsigned rcode :4; /*%< response code */
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /*%< recursion desired */
unsigned tc :1; /*%< truncated message */
unsigned aa :1; /*%< authoritative answer */
unsigned opcode :4; /*%< purpose of message */
unsigned qr :1; /*%< response flag */
/* fields in fourth byte */
unsigned rcode :4; /*%< response code */
unsigned cd: 1; /*%< checking disabled by resolver */
unsigned ad: 1; /*%< authentic data from named */
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /*%< recursion available */
#endif
/* remaining bytes */
unsigned qdcount :16; /*%< number of question entries */
unsigned ancount :16; /*%< number of answer entries */
unsigned nscount :16; /*%< number of authority entries */
unsigned arcount :16; /*%< number of resource entries */
} HEADER;
这是我能找到的最旧的版本。看起来它可能代表“问题”,而不是“查询”,但我仍然不知道“D 代表什么。
uestionDefinition或更好的QueryDefinition,因为每个包含的元素都被称为查询。