Domain Name System (DNS) problems can feel mysterious, but they’re usually caused by a handful of predictable issues. In this guide we’ll walk you through the most common DNS hiccups, give you real commands to run, and show you exactly how to fix them—no advanced networking degree required.
What You’ll Need
- A computer with administrator rights (Windows, macOS, or Linux)
- Access to the network router or DHCP server (optional but helpful)
- A command‑line terminal (Command Prompt, PowerShell, Terminal)
- Internet connectivity for testing external sites
Step 1: Verify the Symptom
Before you dive into settings, confirm that the problem is truly DNS‑related. Open a terminal and try to reach a website by IP address and by name:
ping 8.8.8.8 # Should succeed if the network is up ping www.google.com # Fails if DNS can’t resolve the name
If the IP ping works but the name ping fails, you’re looking at a DNS issue.
Step 2: Check Local DNS Configuration
On Windows, run:
ipconfig /all
Look for the “DNS Servers” line. On macOS or Linux, use:
cat /etc/resolv.conf
Make sure the listed servers are reachable (usually your router’s IP or a public DNS like 8.8.8.8). If the list is empty or points to an incorrect address, you’ll need to correct it.
Step 3: Test DNS Resolution Directly
Use the built‑in tools to query a DNS server manually. This isolates whether the problem is with your computer or the server.
Windows (PowerShell):
Resolve-DnsName -Name www.google.com -Server 8.8.8.8
macOS / Linux:
dig @8.8.8.8 www.google.com nslookup www.google.com 8.8.8.8
If the query returns an answer, the server itself is fine. If it times out, the server is unreachable or blocked.
Step 4: Flush the DNS Cache
Stale or corrupted cache entries are a frequent cause of intermittent failures.
Windows:
ipconfig /flushdns
macOS (Big Sur and later):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux (systemd‑resolved):
sudo systemd-resolve --flush-caches
After flushing, retry the name ping from Step 1.
Step 5: Restart Network Services
Sometimes the network adapter or DNS client service gets stuck.
Windows:
net stop "Dnscache" net start "Dnscache" netsh interface reset all
macOS:
sudo ifconfig en0 down && sudo ifconfig en0 up # replace en0 with your interface
Linux (NetworkManager):
sudo systemctl restart NetworkManager
Re‑test connectivity after the restart.
Step 6: Verify Router/DHCP DNS Settings
If multiple devices on the same network share the problem, the culprit is often the router’s DNS configuration.
1. Log into the router’s web UI (usually http://192.168.1.1 or http://192.168.0.1).
2. Navigate to the DHCP or LAN settings page.
3. Confirm that the DNS server fields point to valid addresses (e.g., 8.8.8.8, 1.1.1.1, or your ISP’s servers).
4. Save changes and reboot the router.
After the router restarts, renew the DHCP lease on a client:
# Windows ipconfig /release ipconfig /renew # macOS / Linux sudo dhclient -r && sudo dhclient
Common Mistakes to Avoid
• Using the wrong DNS IP. Typing 8.8.4.4 as 8.8.4.4.0 will break resolution instantly.
• Changing DNS on the router but forgetting to reboot. Some routers cache the old settings until a power‑cycle.
• Flushing the cache but not the browser cache. Browsers keep their own DNS cache; clear it via settings or restart the browser.
• Editing /etc/resolv.conf directly on Linux. Many modern distros overwrite this file via NetworkManager; use nmcli or systemd-resolved instead.
• Assuming a firewall is the cause. Firewalls rarely block outbound DNS (UDP/53) unless explicitly configured; check rules only after other steps fail.
Tips and Tricks
• Keep a secondary public DNS (e.g., 1.1.1.1) on hand for quick swaps.
• Use tracert or traceroute to see if packets reach the DNS server before they time out.
• On Windows, the nslookup interactive mode lets you test multiple servers without re‑typing the command each time.
• For intermittent failures, enable DNS logging on your router (if supported) to spot timeouts.
• On macOS, the scutil --dns command gives a detailed view of the resolver order.
Frequently Asked Questions
Why does my DNS work on one device but not another?
Different devices may be using different DNS servers—one might be pulling the router’s DNS while another is set to a hard‑coded public server. Verify each device’s resolver list (see Step 2) and align them.
Can a VPN affect DNS resolution?
Yes. Many VPN clients push their own DNS servers to prevent leaks. If you disconnect the VPN and DNS stops working, the client may have overwritten your system settings. Re‑connect the VPN or manually restore your original DNS entries.
Is DNS over HTTPS (DoH) a solution for these problems?
DoH encrypts DNS queries, which can bypass ISP‑level DNS hijacking, but it doesn’t fix local misconfigurations like a wrong DNS IP or a stale cache. Use DoH as a supplement, not a replacement, for proper DNS troubleshooting.
Conclusion
DNS issues are frustrating, but with a systematic approach—confirming the symptom, checking configuration, flushing caches, and verifying router settings—you can resolve the vast majority of problems in minutes. Keep a cheat sheet of the commands above, and remember that the most common culprits are simple typos or outdated cache entries. Happy networking!
Photo by David Pupăză on Unsplash





