如何查看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-OK
 localhost6.localdomain6          H      93     -1  1( 0)                                           ::1-OK
 localhost6                       H      93     -1  1( 0)                                           ::1-OK
 localhost.localdomain            H      93     -1  1( 0)                                           ::1-OK
 localhost                        H      93     -1  1( 0)                                           ::1-OK
 localhost4.localdomain4          H      93     -1  1( 0)                                     127.0.0.1-OK
 localhost4                       H      93     -1  1( 0)                                     127.0.0.1-OK
 www.baidu.com                         1139  -1079  2( 0)                                103.235.47.188-OK
                                                                                          103.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

相关推荐
pcj_88814 天前
给Squid代理添加HTTP basic认证
http·squid
nangonghen25 天前
华为云云连接+squid进行正向代理上网冲浪
华为云·squid
weixin_434255611 年前
如何安装和配置代理服务器squid?
ubuntu·proxy·squid