求助:无法重启dnscache(DNS Client)服务,缓存DNS记录无法清除
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 /flushdnsagain, and verify withipconfig /displaydnsto 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
StartTypeshowsDisabled, 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:
- 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).
- Navigate to
C:\Windows\System32\dns - Find the
cache.dnsfile, right-click it, and delete it (you’ll need admin permissions to do this). - Reboot your PC normally—Windows will automatically recreate a fresh cache file. Run
ipconfig /flushdnsafterward 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

