Catalogue
刷新 DNS 缓存需要重起 nscd daemon:
要重起 nscd daemon,在终端输入/etc/rc.d/init.d/nscd restart
命令执行完毕,你的DNS缓存就被刷新了。
如果是比较新的Linux版本,你可能需要使用下面的命令:/etc/init.d/nscd restart
或者也许你的系统使用的是 systemd 来管理服务,那就使用命令:sudo systemctl restart nscd
当然也有可能系统使用的不是 nscd 而是 systemd-resolve,那就使用命令:sudo systemd-resolve --flush-caches
少数情况下,还有的系统使用了 dnsmasq 或者 named,那就使用命令:
1 | sudo systemctl restart dnsmasq |