DNS Troubleshooting — Diagnosing and Resolving Name Resolution Problems¶
DNS Troubleshooting is the process of identifying and resolving issues that prevent devices from translating domain names into IP addresses. Since almost every Internet application depends on the Domain Name System (DNS), even a small DNS issue can make websites, email, cloud services, Kubernetes applications, APIs, and enterprise systems appear unavailable. A structured troubleshooting methodology helps quickly identify whether the problem lies with the client, DNS server, network, DNS records, or external infrastructure. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should master DNS troubleshooting.
Learning Path¶
Course Progress
What You'll Learn¶
After completing this lesson, you'll be able to:
- Troubleshoot DNS issues
- Diagnose DNS resolution failures
- Verify DNS records
- Understand DNS caching problems
- Use Linux DNS troubleshooting tools
- Troubleshoot enterprise and cloud DNS
- Follow a systematic troubleshooting methodology
Prerequisites¶
Complete:
Why Learn DNS Troubleshooting?¶
Imagine a user reports:
Possible causes include:
- Internet Failure
- DNS Server Failure
- Incorrect DNS Records
- Firewall Rules
- DNS Cache
- Network Connectivity
Without systematic troubleshooting:
Common DNS Problems¶
Most DNS incidents fall into these categories:
- DNS Server Unreachable
- Incorrect DNS Records
- Expired or Stale Cache
- Wrong DNS Configuration
- DNS Propagation Delay
- Firewall Blocking DNS
- Split DNS Misconfiguration
DNS Troubleshooting Workflow¶
Identify Problem
↓
Check Network
↓
Check DNS Configuration
↓
Query DNS
↓
Verify DNS Records
↓
Check Cache
↓
Test Resolution
↓
Fix Problem
Step 1 — Verify Network Connectivity¶
Before troubleshooting DNS:
Test connectivity.
If the IP is reachable:
If not:
Step 2 — Verify DNS Configuration¶
Check configured DNS servers.
Example:
Verify that the configured DNS servers are correct and reachable.
Step 3 — Test Name Resolution¶
Query a domain.
or
Successful resolution confirms DNS is functioning.
Step 4 — Query Specific DNS Server¶
Query a known DNS server.
If this succeeds while the default resolver fails:
Step 5 — Check DNS Records¶
Query specific record types.
A Record:
AAAA Record:
MX Record:
NS Record:
TXT Record:
Step 6 — Trace DNS Resolution¶
Trace the complete lookup path.
This shows:
Useful for identifying where resolution fails.
Step 7 — Reverse Lookup¶
Verify reverse DNS.
or
Step 8 — Check Local Hosts File¶
Linux checks:
Example:
Incorrect entries can override DNS results.
Step 9 — Check DNS Cache¶
Cached records may be outdated.
Depending on the Linux distribution and resolver service, you may need to flush or restart the local DNS cache.
Examples:
or
Availability depends on the DNS resolver in use.
Step 10 — Verify Firewall¶
DNS uses:
and sometimes:
Ensure firewalls allow DNS traffic.
Common DNS Errors¶
NXDOMAIN¶
Meaning:
Possible causes:
- Typo
- Missing DNS Record
- Incorrect Zone Configuration
SERVFAIL¶
Meaning:
Possible causes:
- Server Issues
- Domain Name System Security Extensions (DNSSEC) Problems
- Upstream Failure
Timeout¶
Meaning:
Possible causes:
- Firewall
- Network Failure
- DNS Server Down
REFUSED¶
Meaning:
Possible causes:
- Access Restrictions
- Access Control List (ACL) Configuration
- Recursive Queries Disabled
Enterprise Troubleshooting¶
Scenario:
Employee cannot access:
Checklist:
- Network Connectivity
- DNS Server Reachability
- Internal DNS Zone
- Split DNS Configuration
- Firewall Rules
- Application Availability
Cloud Perspective¶
Cloud DNS issues may involve:
- Private DNS Zones
- Public DNS Zones
- Load Balancers
- Private Endpoints
- Hybrid Cloud Connectivity
Verify that the correct DNS zone is being queried.
Kubernetes Perspective¶
Common Kubernetes DNS issues:
- CoreDNS Pod Failure
- Incorrect Service Name
- Network Policy Restrictions
- Service Not Running
Useful commands:
Linux Perspective¶
Display DNS configuration.
Query DNS.
Trace resolution.
Query using host.
Display resolver configuration.
(Test on systems using systemd-resolved.)
DNS Troubleshooting Example¶
Problem:
Steps:
Ping IP
↓
Check Internet
↓
Check DNS Server
↓
dig github.com
↓
Verify A Record
↓
Check Firewall
↓
Resolve Issue
Advantages of a Structured Approach¶
- Faster Diagnosis
- Consistent Results
- Reduced Downtime
- Easier Root Cause Analysis
- Better Incident Documentation
Hands-on Lab¶
Task 1¶
Display configured DNS servers.
Task 2¶
Query a domain.
Task 3¶
Trace DNS resolution.
Task 4¶
Query a specific DNS server.
Task 5¶
Perform a reverse lookup.
Task 6¶
Check the hosts file.
Task 7¶
Create a troubleshooting checklist for:
- NXDOMAIN
- SERVFAIL
- Timeout
- REFUSED
Task 8¶
Troubleshoot a simulated DNS issue where users cannot reach an internal application.
Document:
- Symptoms
- Investigation
- Root Cause
- Resolution
Linux Commands¶
| Command | Purpose |
|---|---|
cat /etc/resolv.conf | View DNS configuration |
dig domain.com | DNS lookup |
dig +trace domain.com | Trace resolution path |
dig @server domain.com | Query specific DNS server |
dig -x <IP> | Reverse lookup |
host domain.com | Display DNS information |
nslookup domain.com | DNS lookup |
resolvectl status | Display resolver status (systemd-resolved) |
Common Mistakes¶
❌ Assuming every connectivity problem is DNS-related.
✅ Test connectivity using IP addresses first.
❌ Ignoring local hosts file entries.
✅ Verify /etc/hosts.
❌ Troubleshooting only one DNS server.
✅ Test multiple resolvers.
❌ Forgetting DNS cache.
✅ Flush or wait for cache expiration if appropriate.
❌ Ignoring firewall rules.
✅ Ensure UDP and TCP port 53 are allowed where required.
Best Practices¶
- Verify network connectivity before troubleshooting DNS.
- Use
digas the primary DNS diagnostic tool. - Query authoritative servers when validating records.
- Keep DNS records documented.
- Monitor DNS server health.
- Maintain redundant DNS infrastructure.
- Test both internal and external DNS in Split DNS environments.
Interview Questions¶
Beginner¶
- What is DNS troubleshooting?
- Which command checks DNS resolution?
- What is NXDOMAIN?
- What file stores static hostname mappings in Linux?
Intermediate¶
- Explain how
dig +traceworks. - What causes SERVFAIL?
- How do you troubleshoot DNS timeouts?
- Why is reverse DNS important?
Architect Level¶
- Design a DNS troubleshooting workflow for an enterprise.
- How would you diagnose intermittent DNS failures in a hybrid cloud?
- Explain how you would troubleshoot Split DNS issues.
Summary¶
In this lesson, you learned:
- DNS Troubleshooting Methodology
- DNS Resolution Failures
- DNS Error Codes
- DNS Cache
- Hosts File
- DNS Configuration
- Linux DNS Diagnostic Commands
- Enterprise and Cloud DNS Troubleshooting
A systematic DNS troubleshooting process helps quickly isolate and resolve name resolution problems. By verifying connectivity, checking resolver configuration, testing DNS records, tracing resolution paths, and validating caches, administrators can efficiently diagnose issues affecting enterprise, cloud, and Internet services.
Key Takeaways¶
- Always verify network connectivity before assuming a DNS problem.
- Use
digto test DNS resolution and record types. dig +traceidentifies failures along the DNS resolution path.- Check
/etc/hostsand DNS cache during troubleshooting. - Understand common DNS errors such as NXDOMAIN, SERVFAIL, and Timeout.
- A structured troubleshooting workflow reduces downtime and speeds up incident resolution.
Module 6 Complete!¶
Congratulations! You have successfully completed Module 6: DNS & DHCP.
You now understand:
- DNS Fundamentals
- DNS Records
- DNS Resolution
- DHCP Process
- DHCP Relay
- Split DNS
- DNS Troubleshooting
You now have a strong foundation in two of the most important network infrastructure services used across enterprise networks, cloud platforms, Kubernetes environments, and the Internet.