You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:无法重启dnscache(DNS Client)服务,缓存DNS记录无法清除

Fixing Unclearable DNS Cache on Windows

Hey there, I’ve dealt with this exact stubborn DNS cache issue before—let’s walk through some targeted fixes since the usual ipconfig /flushdns and net stop dnscache aren’t working for you, even after removing Hyper-V.

Step 1: Use PowerShell (Admin) to Force Stop/Start the DNS Client Service

The CMD net stop command might be hitting permission or service state roadblocks. Let’s switch to PowerShell with elevated rights instead:

  • Open PowerShell as Administrator (right-click Start > Windows PowerShell (Admin))
  • Run this to force stop the DNS Client service:
    Stop-Service -Name dnscache -Force
    
  • Then restart it:
    Start-Service -Name dnscache
    
  • Now run ipconfig /flushdns again, and verify with ipconfig /displaydns to check if the cache is cleared.

Step 2: Check and Repair the DNS Client Service Startup Type

If the service is stuck in a weird state (like disabled or manual with no auto-start), that can break cache flushing:

  • In the same admin PowerShell, check the service status:
    Get-Service dnscache | Select-Object Name, StartType, Status
    
  • If StartType shows Disabled, set it to Automatic:
    Set-Service dnscache -StartupType Automatic
    
  • Restart the service again with the commands from Step 1, then flush DNS once more.

Step 3: Manually Delete the Corrupted DNS Cache File

Sometimes the cache file itself gets corrupted, making it unresponsive to standard commands:

  1. First, try stopping the DNS Client service via PowerShell (Step 1). If that still fails, boot your PC into Safe Mode (restart, hold Shift > Troubleshoot > Advanced Options > Startup Settings > Enable Safe Mode).
  2. Navigate to C:\Windows\System32\dns
  3. Find the cache.dns file, right-click it, and delete it (you’ll need admin permissions to do this).
  4. Reboot your PC normally—Windows will automatically recreate a fresh cache file. Run ipconfig /flushdns afterward to confirm.

Step 4: Reset Your Entire Network Stack

Corrupted network settings can also block DNS cache flushing. Run these commands in an admin CMD:

netsh int ip reset
netsh winsock reset

Restart your PC, then try flushing the DNS cache again.

Step 5: Check for Third-Party Software Interference

Antivirus, firewall, or VPN tools sometimes lock the DNS Client service to prevent tampering. Temporarily disable any such software, then retry net stop dnscache and ipconfig /flushdns. Don’t forget to re-enable them once you’re done!

Quick Verification Tip

Always use ipconfig /displaydns before and after flushing to confirm the cache is cleared. Sometimes it feels like the cache is still there, but you might be reloading a domain right after flushing, which re-caches it instantly.

内容的提问来源于stack exchange,提问作者Walf

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:22:34