Windows

Windows 下刷新 DNS 解析缓存,打开 cmd ,输入

1
ipconfig /flushdns

Linux

查看当前正在使用的 DNS 解析服务

1
cat /etc/resolv.conf

如果使用的是类似于

root@debian:~# cat /etc/resolv.conf
search debian
nameserver 8.8.8.8

可以直接修改该文件,使用指定的 DNS 解析服务器(重启失效)

在 Ubuntu 20.04 系统上

1
This file is managed by man:systemd-resolved(8). Do not edit

直接查看 53 端口上运行的相关服务

1
lsof -i :53 -S

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-r 335 systemd-resolve 12u IPv4 17538 0t0 UDP localhost:domain
systemd-r 335 systemd-resolve 13u IPv4 17539 0t0 TCP localhost:domain (LISTEN)

清空缓存

1
systemd-resolve --flush-caches

查看当前缓存大小

1
systemd-resolve --statistics

其它情况遇到再补充