首先,在终端输入:tcpdump port 53 ,过滤DNS端口的报文。
然后另外打开一个终端:ping 一个网站,我ping的是:
ping www.17173.com
tcpdump抓包如下:
09:17:59.658394 IP datou97-Lenovo.local.55968 > es.sia.ac.cn.domain: 182+ A? www.17173.com. (31)
09:17:59.659052 IP datou97-Lenovo.local.51202 > es.sia.ac.cn.domain: 47999+ PTR? 131.131.72.210.in-addr.arpa. (45)
09:17:59.659161 IP es.sia.ac.cn.domain > datou97-Lenovo.local.55968: 182 7/0/0 CNAME pooldist.17173.com., CNAME poolcnc.17173.com., A 58.22.102.18, A 58.22.102.19, A 58.22.102.6, A 58.22.102.7, A 58.22.102.8 (156)
09:17:59.659616 IP es.sia.ac.cn.domain > datou97-Lenovo.local.51202: 47999* 1/0/0 PTR es.sia.ac.cn. (71)
09:17:59.659736 IP datou97-Lenovo.local.57584 > es.sia.ac.cn.domain: 62523+ PTR? 12.137.72.210.in-addr.arpa. (44)
09:17:59.736580 IP datou97-Lenovo.local.48173 > es.sia.ac.cn.domain: 49300+ PTR? 18.102.22.58.in-addr.arpa. (43)
09:17:59.742163 IP es.sia.ac.cn.domain > datou97-Lenovo.local.57584: 62523 ServFail 0/0/0 (44)
09:17:59.742214 IP datou97-Lenovo.local.46891 > es.sia.ac.cn.domain: 62523+ PTR? 12.137.72.210.in-addr.arpa. (44)
09:17:59.770901 IP es.sia.ac.cn.domain > datou97-Lenovo.local.46891: 62523 ServFail 0/0/0 (44)
09:17:59.814466 IP es.sia.ac.cn.domain > datou97-Lenovo.local.48173: 49300 NXDomain*- 0/1/0 (100)
09:18:04.891874 IP datou97-Lenovo.local.35451 > es.sia.ac.cn.domain: 5870+ PTR? 18.102.22.58.in-addr.arpa. (43)
09:18:04.892384 IP es.sia.ac.cn.domain > datou97-Lenovo.local.35451: 5870 NXDomain 0/1/0 (100)
09:18:09.971483 IP datou97-Lenovo.local.53818 > es.sia.ac.cn.domain: 51076+ PTR? 18.102.22.58.in-addr.arpa. (43)
09:18:09.972117 IP es.sia.ac.cn.domain > datou97-Lenovo.local.53818: 51076 NXDomain 0/1/0 (100)