本文主要是介绍如何查看Squid的DNS缓存,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
使用squidclient mgr:ipcache
命令查看Squid的DNS缓存记录
如果squid端口不是3128, 需要指定端口号, squidclient -p {port} mgr:ipcache
# squidclient mgr:ipcache
...
IP Cache Statistics:
...
IP Cache Contents:Hostname Flg lstref TTL N(b)www.trendmicro.com 19 41 1( 0) 23.195.109.63-OKlocalhost6.localdomain6 H 93 -1 1( 0) ::1-OKlocalhost6 H 93 -1 1( 0) ::1-OKlocalhost.localdomain H 93 -1 1( 0) ::1-OKlocalhost H 93 -1 1( 0) ::1-OKlocalhost4.localdomain4 H 93 -1 1( 0) 127.0.0.1-OKlocalhost4 H 93 -1 1( 0) 127.0.0.1-OKwww.baidu.com 1139 -1079 2( 0) 103.235.47.188-OK103.235.46.96-OK
抓包
tcpdump udp port 53 -w dns.pcap
curl -x 127.0.0.1:3128 https://www.baidu.com
参考
https://wiki.squid-cache.org/Features/CacheManager/IpCache
这篇关于如何查看Squid的DNS缓存的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!