If Windows reports “Can’t communicate with device or resource (primary DNS server)” during network troubleshooting, the fix is to correct your DNS server settings or flush the DNS cache. This error means your PC can’t reach the DNS server it’s configured to use, so domain names aren’t resolving to IP addresses. Below are the exact steps to resolve it, plus background on why it happens and how to prevent it.
What This Error Actually Means
The message appears in the Windows Network Diagnostics tool after it runs a series of checks. It’s not a hardware failure — it’s a configuration or connectivity problem between your computer and the DNS server listed in your network adapter’s properties. DNS (Domain Name System) translates human-readable names like example.com into IP addresses. If your PC can’t reach the DNS server, every website lookup fails, even though your internet connection may appear active.
Common triggers include a temporarily down ISP DNS server, a misconfigured router, a stale DNS cache, or a VPN or security suite that overrides DNS settings. The error can also appear when your IP address is set to static but the DNS fields are blank or contain an unreachable address.
Quick Fix: Flush DNS and Reset Network Stack
Start with the simplest solution — clearing the local DNS cache and resetting the network stack. This fixes most cases where the cache holds bad entries.
- Open Command Prompt as Administrator (search “cmd”, right-click, “Run as administrator”).
- Type
ipconfig /flushdnsand press Enter. - Type
ipconfig /registerdnsand press Enter. - Type
ipconfig /releasethenipconfig /renew(this gets a fresh IP from your router). - Type
netsh winsock resetand press Enter. - Type
netsh int ip resetand press Enter. - Restart your computer.
If the error persists, move on to checking your DNS server addresses manually.
Change DNS Server Settings Manually
If flushing didn’t work, your adapter is probably pointing to a DNS server that’s unreachable. Override it with a reliable public DNS.
- Open Control Panel → Network and Sharing Center → Change adapter settings.
- Right-click your active connection (Wi-Fi or Ethernet) and select Properties.
- Select “Internet Protocol Version 4 (TCP/IPv4)” and click Properties.
- Choose “Use the following DNS server addresses.”
- Enter a primary and secondary DNS. Common public options:
- Google: 8.8.8.8 and 8.8.4.4
- Cloudflare: 1.1.1.1 and 1.0.0.1
- Quad9: 9.9.9.9 and 149.112.112.112
Click OK, then repeat for “Internet Protocol Version 6 (TCP/IPv6)” if you have IPv6 enabled — you can set it to obtain automatically or use Google’s IPv6 addresses (2001:4860:4860::8888 and 2001:4860:4860::8844). After applying, reopen the troubleshooter — the error should be gone.
Router and Modem Checks
Your router is the middleman between your PC and your ISP’s DNS. If the router itself has a bad DNS setting, every device on the network will see the same error. Log into your router’s admin page (usually 192.168.1.1 or 192.168.0.1) and look for DNS settings under WAN or Internet. Set them to automatic, or enter the same public DNS addresses you used on your PC. Then restart the router by unplugging it for 30 seconds and plugging it back in.
Also check if the problem affects other devices. If your phone can browse but your PC can’t, the issue is local to the PC. If all devices fail, the router or ISP is the culprit.
VPN and Security Software Interference
VPN clients and some antivirus suites install their own network drivers or DNS filters. These can hijack DNS queries and point them to a server that’s temporarily unreachable. If you have a VPN, disconnect it and test. If the error disappears, the VPN’s DNS is the problem — check its settings for an option to use the system DNS or a different server.
Similarly, security suites with web protection features may block or reroute DNS. Temporarily disable the firewall or web shield (not the real-time antivirus) and test. If it works, add an exception for your browser or adjust the DNS filter settings. Remember to re-enable protection afterward.
Check Hosts File and Proxy Settings
A corrupted hosts file or an active proxy can cause DNS errors even when your DNS settings are correct. The hosts file maps domain names to IP addresses manually — a bad entry can override everything.
- Open Notepad as Administrator.
- Go to File → Open and navigate to
C:\Windows\System32\drivers\etc\hosts. - Look for lines that aren’t commented out (don’t start with #). Legitimate entries are rare — if you see unknown domains, they may be malicious.
- Delete suspicious lines, save, and close.
For proxy settings: Settings → Network & Internet → Proxy. Ensure “Use a proxy server” is off unless you actually use one. A misconfigured proxy can make Windows think the DNS server is unreachable.
Frequently Asked Questions
Why does the error say “primary DNS server” when I have two?
Windows tries the primary DNS server first. If it doesn’t get a response within a timeout, it moves to the secondary. The error appears when both fail, or when the primary is unreachable and the secondary isn’t configured properly. The fix is the same — set both to reliable public addresses.
Is this error dangerous?
Not usually — it’s a connectivity issue, not a virus. However, if your DNS settings were changed without your knowledge, that could indicate malware. Run a full antivirus scan if you didn’t change the settings yourself.
Will changing DNS to Google or Cloudflare speed up my internet?
It can, especially if your ISP’s DNS is slow or overloaded. Public DNS servers are often faster and more reliable. But if your connection is slow due to bandwidth, DNS won’t fix that.
Why does the error come back after I fix it?
If it returns, something is resetting your DNS settings — likely a VPN, a security suite, or a router that pushes its own DNS via DHCP. Check those first. Also ensure your network adapter isn’t set to obtain DNS automatically if you manually configured it — a conflict can cause intermittent failures.
Can I use a DNS server from a different country?
Yes, but it may be slower due to distance. It can also cause geo-restricted content to appear from that country. For general use, stick with servers in your region or well-known global ones.
Does this error affect gaming or streaming?
It can. Games and streaming services use DNS to connect to servers. If DNS fails, they can’t resolve the server names. Once you fix DNS, those services should work again.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Google Chrome Helper: What It Is & How to Disable
- Fix 0x80070422 on Windows Server (Step-by-Step)
- How to Troubleshoot a Malfunctioning Driver on Windows
- How to Create Folders in Microsoft Outlook
- Fix Status Range List Conflict 0xc0000282 in Windows
- Fix Software Not Uninstalling on Windows 10