在 Windows 上刷新 DNS 解析缓存

清空本机 DNS 缓存,让 Windows 重新解析域名——网站换服务器后仍访问旧 IP 的经典修复方法。

Windows网络DNS故障排查中风险
运行 `ipconfig /flushdns` 清空 DNS 客户端缓存,然后重新访问网站。

01命令

命令
$ ipconfig /flushdns

02作用说明

Windows 会把每次 DNS 查询结果缓存到本地(按记录的 TTL 保留),所以 DNS 记录更新后你可能还会被指到旧 IP 好几个小时。想先看看缓存了什么,可以运行 `ipconfig /displaydns`。刷新是即时且安全的,只是让后续查询重新请求 DNS 服务器;注意浏览器自带独立缓存(如 Chrome),必要时还需重启浏览器。

03风险

风险中风险

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • ipconfig | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    依据: Microsoft documents that 'ipconfig /flushdns' flushes and resets the contents of the DNS client resolver cache, and that /displaydns displays its contents.
  • IPCONFIG - Windows CMD
    SS64 · technical · 2026-09-17
    依据: SS64 lists /displaydns to view cached DNS entries and /flushdns to purge the DNS resolver cache.

最后验证: 2026-09-17 · 分类: 网络

06相关方案