大网数据广告活动
服务器运维问答

Wireshark find DNS response "Refused"

· 52CE 我爱测

I'm looking for a way to filter a packet capture in wireshark for instances where our server responds with "Refused" to a recursive DNS query. dns.resp.type== doesn't seem to offer anything that I see as a match to my request, do…

问题原文

原帖链接 · tink · CC BY-SA 4.0

I'm looking for a way to filter a packet capture in wireshark for instances where our server responds with "Refused" to a recursive DNS query.

dns.resp.type== doesn't seem to offer anything that I see as a match to my request, do I need to look somewhere other than under dns.resp altogether?

已采纳解答

原帖链接 · Patrick Mevzek · CC BY-SA 4.0

Based on https://www.wireshark.org/docs/dfref/d/dns.html you need to use dns.flags.rcode defined as:

dns.flags.rcode Reply code Unsigned integer, 2 bytes 1.0.0 to 3.4.9

"Reply code" is defined in §4.1.1. of RFC 1035 as "response code" with "Refused" being value 5:

5 Refused - The name server refuses to perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.

As Wireshark defines it as 2 bytes, maybe it is the whole structure depicted in the RFC:

                                    1  1  1  1  1  1
      0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |                      ID                       |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |QR|   Opcode  |AA|TC|RD|RA|   Z    |   RCODE   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

So to compare RCODE to value 5 you may have to mask other bits.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-11-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。