Whatâs the first thing you do when a user says âthe internet isnât workingâ?
If your answer is âflush the DNS cache,â youâre in good company. Itâs also probably wrong.
DNS troubleshooting has become ITâs equivalent of turning it off and on againâa ritual performed more out of habit than understanding. The problem with ritualistic troubleshooting is that it works just often enough to reinforce bad habits, while wasting enormous amounts of time when the actual issue is something else entirely. If youâre working a help desk role or studying for IT certifications, understanding DNS properly will set you apart.
This guide is different. Youâre going to learn how DNS actually fails, what those failures look like, and how to systematically identify the real problem instead of guessing. By the end, youâll handle DNS tickets faster than anyone else on your team, and youâll understand why.
Why DNS Breaks (And Why âFlush the Cacheâ Usually Isnât the Answer)
DNS failures fall into a handful of categories. Once you recognize which category youâre dealing with, the fix becomes obvious.
The Client Canât Reach Any DNS Server
The userâs machine is configured to use a DNS server it canât actually communicate with. This happens when:
- The configured DNS server IP is wrong or outdated
- Network connectivity is broken between the client and DNS server
- A firewall is blocking DNS traffic (UDP/TCP port 53)
- The DNS server itself is down
When this is the problem, nothing resolves. Not google.com, not your internal sharepoint site, nothing. The user sees âDNS server not respondingâ or similar messages in their browser.
The DNS Server Canât Resolve the Query
The DNS server is reachable, but it fails to resolve specific domains. This could be:
- An authoritative server is misconfigured or unreachable
- The domainâs DNS records are broken or missing
- DNSSEC validation is failing
- The DNS server is experiencing issues with recursion
When this is the problem, some sites work and others donât. You can typically ping by IP address even when DNS resolution fails.
The DNS Response is Wrong or Stale
The DNS server responds, but with incorrect information. Causes include:
- Cached records that havenât updated after changes
- DNS hijacking (by captive portals, malware, or ISP interception)
- Misconfigured records at the authoritative server
- Split-horizon DNS returning the wrong response for the clientâs location
When this is the problem, connections fail in weird ways. A site might load partially, redirect unexpectedly, or show security certificate errors because itâs reaching the wrong server.
The Application is Bypassing System DNS
Some applications use their own DNS resolution, ignoring system settings entirely. Browsers like Firefox and Chrome can use DNS over HTTPS (DoH), which means flushing the system DNS cache does absolutely nothing.
When this is the problem, the same site works in one browser but not another, or works from command-line tools but not applications.
The Diagnostic Toolkit: Commands You Actually Need
Before you can fix DNS problems, you need to identify them precisely. These are the commands that matter. Many sysadmin jobs require solid DNS troubleshooting skills.
nslookup: The Cross-Platform Standard
Available on Windows, macOS, and Linux, nslookup queries DNS servers directly. Itâs not the most powerful tool, but itâs everywhere.
Basic query:
nslookup google.com
This tells you what DNS server answered and what IP address it returned. If it times out, your system canât reach its configured DNS server.
Query a specific DNS server:
nslookup google.com 8.8.8.8
This bypasses your systemâs configured DNS and queries Googleâs public DNS directly. If this works but the first command doesnât, your local DNS server is the problem.
Check specific record types:
nslookup -type=MX example.com
nslookup -type=TXT example.com
nslookup -type=NS example.com
MX records tell you where email should go. TXT records often contain SPF and DKIM settings. NS records show which servers are authoritative for the domain.
dig: The Professionalâs Choice
dig (Domain Information Groper) provides more detailed output and better control. Itâs standard on Linux and macOS; Windows users can install it through BIND or use WSL. If youâre learning bash scripting, dig is often combined with other commands to create automated monitoring scripts.
Basic query:
dig google.com
The output shows the question, answer, and metadata including TTL (how long the response is cached) and which server answered.
Query a specific DNS server:
dig @8.8.8.8 google.com
Get just the answer:
dig +short google.com
Trace the full resolution path:
dig +trace google.com
This shows every step from root servers to authoritative servers. Invaluable when tracking down where resolution fails.
Check all common record types:
dig google.com ANY
Note: Some DNS servers donât respond to ANY queries for security reasons. If you get an empty response, query specific record types individually.
If youâre looking to sharpen your command-line skills for DNS work and beyond, Shell Samurai offers hands-on terminal exercises that build the muscle memory you need for rapid troubleshooting.
Windows-Specific Commands
PowerShell provides modern cmdlets for DNS management, while cmd still works for quick checks.
View current DNS configuration:
Get-DnsClientServerAddress
Or the older method:
ipconfig /all
View the DNS cache:
Get-DnsClientCache
Or:
ipconfig /displaydns
Flush the DNS cache:
Clear-DnsClientCache
Or:
ipconfig /flushdns
View DNS resolution policy (if your organization uses NRPT):
Get-DnsClientNrptPolicy
For Windows Server DNS troubleshooting, Microsoftâs official guidance covers server-side issues in detail. Our Windows Server tutorial provides broader context for these administrative tasks.
Linux-Specific Commands
Check your systemâs DNS configuration:
cat /etc/resolv.conf
On systemd-based systems:
resolvectl status
Flush systemd-resolved cache:
sudo resolvectl flush-caches
Restart the resolver service (if caching issues persist):
sudo systemctl restart systemd-resolved
Our Linux basics guide covers these commands in context if you need a refresher on Linux system administration. For understanding systemd services, see our dedicated tutorial.
The Systematic Troubleshooting Process
Hereâs the process that separates methodical troubleshooters from cache-flushers. Follow it in order.
Step 1: Verify Itâs Actually a DNS Problem
Before touching DNS settings, confirm that DNS is the issue.
Try accessing a site by IP address:
ping 142.250.80.46
(Thatâs one of Googleâs IPs)
If this works but ping google.com fails, you have a DNS problem. If both fail, you have a network connectivity problemâDNS isnât your issue.
Check if other services using DNS work:
Can you ping internal hostnames? Can you access other websites? If some DNS works and some doesnât, youâre looking at a partial failure, which narrows down the cause significantly.
Step 2: Identify Where Resolution Fails
Query your systemâs configured DNS:
nslookup problematic-domain.com
Query a public DNS server:
nslookup problematic-domain.com 8.8.8.8
nslookup problematic-domain.com 1.1.1.1
If the public DNS servers resolve the domain but your configured DNS doesnât:
- Your local DNS server has a problem
- Your local DNS server is blocking the domain
- Your local DNS serverâs cache is stale
If neither resolves the domain, the problem is with the domain itself or its authoritative DNS servers.
Step 3: Trace the Resolution Path
For domains that arenât resolving through any DNS server:
dig +trace problematic-domain.com
Watch where the trace stops. Does it fail at the TLD servers? At the authoritative nameservers? This tells you exactly where to focus your investigation.
Step 4: Check the Authoritative Records
Find the authoritative nameservers:
dig NS problematic-domain.com
Query them directly:
dig @ns1.authoritative-server.com problematic-domain.com
If the authoritative servers donât respond or return incorrect records, the problem is at the domain registrar or DNS hosting levelânot something you can fix locally.
Step 5: Examine TTL and Caching
Look at the TTL values in your dig output:
dig google.com
The ANSWER SECTION shows TTL values (in seconds) for each record. If youâve recently changed DNS records and they havenât propagated, check whether the TTL has elapsed since the change.
Common TTL values:
- 300 (5 minutes): Changes propagate quickly
- 3600 (1 hour): Standard setting
- 86400 (24 hours): Maximum recommended; changes propagate slowly
If someone set TTLs to 86400 and then changed hosting providers yesterday, some users will still see old records until today.
Common Scenarios and Their Fixes
Letâs apply this framework to situations youâll encounter regularly. These are the scenarios that come up in help desk interviews and daily support work.
Scenario: âThe Internet Isnât Workingâ (Single User)
Symptoms: User reports all websites fail to load. Other users are fine.
Diagnostic steps:
- Check if the user can ping an IP address (verify network connectivity)
- Check the userâs DNS settings (
ipconfig /allon Windows) - Try querying a public DNS server
Common causes:
- DHCP gave the user a bad DNS server address
- User manually configured an invalid DNS server
- Malware changed DNS settings to point to malicious servers (a red flag worth mentioning to your security team)
- VPN software overrode DNS settings
Fix: Compare the userâs DNS settings to a working machine. Reset to DHCP-provided settings or manually configure known-good DNS servers.
Scenario: Specific Website Doesnât Load (Multiple Users)
Symptoms: One particular external website fails for everyone in the office.
Diagnostic steps:
- Check if the site resolves from a public DNS server
- Check if your internal DNS server resolves it correctly
- Check your firewall/proxy logs for blocks
Common causes:
- Web filtering blocking the domain
- DNS sinkhole for security purposes
- The site itself is actually down
- Your ISP is having routing issues to that site
Fix: If public DNS resolves it correctly, check your internal DNS and web filtering settings. If public DNS also fails, the problem is external.
Scenario: Internal Application Stopped Working
Symptoms: Users canât access an internal application by hostname.
Diagnostic steps:
- Can you access it by IP address?
- What does your internal DNS return for that hostname?
- When did the DNS record last change?
- Is the hostname registered in DNS at all?
Common causes:
- Someone deleted the DNS record
- The serverâs IP changed but DNS wasnât updated
- DNS scavenging removed a stale record (a known issue in Windows Server environments)
- The DNS server hosting that zone is down
Fix: Verify the correct DNS record exists and points to the right IP. Check zone replication if you have multiple DNS servers. If youâre managing Active Directory environments, DNS is tightly integratedâAD issues often manifest as DNS problems.
Scenario: Website Shows Wrong Content or Certificate Errors
Symptoms: A website loads, but shows unexpected content or browser warns about certificate mismatch.
Diagnostic steps:
- What IP does DNS return for that domain?
- Who owns that IP address? (
whoisor IP lookup tools) - Are you going through a proxy or VPN?
Common causes:
- DNS records point to an old server
- CDN or load balancer configuration changed
- Youâre hitting a captive portal thatâs intercepting the request
- DNS hijacking (malicious or ISP-level)
Fix: Verify the returned IP is correct for that service. Check with the site owner or your network administrator if the IP seems wrong.
When to Actually Flush the Cache
After all that, when should you flush DNS caches?
Flush the cache when:
- Youâve confirmed records changed at the authoritative server
- Youâve verified the TTL should have expired but the old record persists
- Youâve ruled out other causes and want to force a fresh lookup
Donât flush the cache when:
- You havenât diagnosed the actual problem yet
- The issue affects only one site and public DNS canât resolve it either
- The problem is intermittent (caching doesnât explain intermittent failures)
Flushing caches is a valid troubleshooting step. Itâs just not the first step.
Advanced: DNS Security Issues
DNS troubleshooting sometimes reveals security problems. Know what to look for. If youâre pursuing a cybersecurity career path, DNS analysis is a foundational skill for threat hunting and incident response.
Signs of DNS Hijacking
- DNS returns IPs owned by suspicious entities
- All failed lookups redirect to the same IP (often an ad page)
- HTTPS sites show certificate errors because theyâre reaching wrong servers
Check your routerâs DNS settings. Consumer routers are frequently compromised to redirect DNS traffic. Enterprise networks should use DNSSEC to validate responses.
DNS over HTTPS (DoH) Complications
Modern browsers use encrypted DNS by default, bypassing your networkâs DNS servers. This is good for privacy but complicates troubleshooting and breaks internal DNS resolution for some organizations.
In Firefox: Settings > Privacy & Security > DNS over HTTPS
In Chrome: Settings > Privacy and security > Security > Use secure DNS
If internal sites fail only in browsers but work in command-line tools, DoH is likely the culprit.
Cache Poisoning Indicators
If DNS randomly returns wrong answers that change between queries, someone might be attempting cache poisoning. Modern DNS servers have protections, but older or misconfigured servers remain vulnerable.
Building DNS Troubleshooting Skills
The best way to learn DNS troubleshooting is to practice when things arenât broken.
Pick a domain and investigate it:
dig +trace amazon.com
dig amazon.com ANY
whois amazon.com
Understand what normal looks like before youâre trying to fix abnormal under pressure. Understanding Wireshark can help you see DNS traffic at the packet level for deeper analysis.
Set up a home lab DNS server. If youâre studying for CompTIA Network+ or similar certifications, running your own DNS gives you safe space to break things and fix them. Our home lab guide covers how to get started.
Read incident postmasters. Companies like Cloudflare publish detailed analyses of DNS outages. These show real-world troubleshooting in action.
The Interview Angle
DNS troubleshooting comes up constantly in IT support interviews. Interviewers want to see systematic thinking, not magic incantations.
Bad answer: âIâd flush the DNS cache and reboot the computer.â
Good answer: âFirst, Iâd verify itâs actually a DNS problem by testing if the user can reach sites by IP address. Then Iâd check what DNS servers the client is configured to use and whether those servers respond to queries. If the local DNS works for other domains, Iâd trace the specific domain to find where resolution fails.â
The difference? The second answer shows you understand what DNS is and can adapt when the obvious fix doesnât work.
If youâre preparing for technical interviews, practice walking through troubleshooting scenarios out loud. Our guide to system administrator interview questions covers more examples.
Frequently Asked Questions
Whatâs the difference between nslookup and dig?
Both query DNS servers, but dig provides more detailed output and better control over queries. nslookup is available everywhere and good for quick checks. dig is preferred for serious troubleshooting because it shows TTLs, flags, and the full response structure. Most DNS professionals use dig when available.
Why does flushing DNS sometimes fix problems even when caching isnât the issue?
The act of flushing the cache doesnât magically fix DNS. What happens is that the time spent flushing gives transient network issues a chance to resolve, or the application retries after youâve made it wait. Correlation isnât causationâthe problem might have resolved itself regardless.
How long does DNS propagation actually take?
It depends on TTL values. If the old record had a 5-minute TTL, propagation happens within 5 minutes after the change. If the TTL was 24 hours, it takes up to 24 hours. â48-72 hoursâ is outdated advice from when TTLs were commonly set higher. Modern configurations usually propagate within an hour.
Should I use Google DNS (8.8.8.8) or Cloudflare DNS (1.1.1.1)?
For troubleshooting, either works fine. For production use, consider: Cloudflare claims faster performance. Google has a longer track record. Both are reliable and offer privacy-focused options (Cloudflareâs 1.1.1.1 claims no logging; Googleâs 8.8.8.8 logs some data). Some organizations block public DNS to enforce internal policiesâcheck before recommending to users.
What causes âDNS server not respondingâ errors?
The client canât communicate with its configured DNS server. Check: Is the server IP correct? Can you ping the server? Is the server actually running DNS services? Is a firewall blocking port 53? Is the server overloaded? The error is generic; any communication failure produces it.
Wrapping Up
DNS troubleshooting isnât complicated once you understand the system. Most problems fall into predictable categories: client canât reach server, server canât resolve query, response is wrong, or application bypasses system DNS.
The key is diagnosis before treatment. Identify which category your problem falls into, then apply the appropriate fix. Flushing caches, restarting services, and switching DNS servers all have their placeâbut only after you know why they might help.
Next time someone says âthe internet isnât working,â youâll know exactly where to start. And it wonât be ipconfig /flushdns.
Building your networking fundamentals? Check out our networking basics guide for the concepts behind these commands, or dive into TCP/IP fundamentals for the protocol-level understanding that makes troubleshooting intuitive. Looking to advance your career? Our help desk to sysadmin guide covers the skills that matter most.