DNS Troubleshooting

Summary

This note is a simple workflow for troubleshooting DNS problems. The goal is to separate name resolution issues from general connectivity problems and to check DNS step by step instead of guessing.

Why this matters

  • DNS failures are one of the most common reasons people say “the network is broken”
  • many services fail in a way that looks like connectivity trouble when the real issue is only name resolution
  • Linux, Windows, cloud, and SOC work all benefit from fast DNS diagnosis

Environment / Scope

ItemValue
TopicDNS troubleshooting
Best use for this notewhen names fail but network state is unclear
Main focusresolver config, lookups, DNS server reachability
Safe to practise?yes

Key concepts

  • separate IP connectivity from name resolution
  • check whether the host has a DNS server configured
  • confirm whether the DNS server is reachable before blaming the application

Steps / Workflow

1. Check whether the host has basic connectivity

ping 8.8.8.8

If raw IP connectivity works, the issue may be DNS rather than general routing.

2. Check the configured DNS servers

cat /etc/resolv.conf

or on modern Linux:

resolvectl status

3. Test name resolution directly

nslookup github.com

or:

dig github.com

4. Test whether the DNS server itself is reachable

ping <dns-server-ip>

5. Compare hostname failure vs direct IP success

If an app works by IP but fails by name, that strongly points towards DNS.

Commands / Examples

CommandPurpose
cat /etc/resolv.confinspect resolver settings
resolvectl statusinspect DNS config on systems using systemd-resolved
nslookup github.comquick DNS resolution test
dig github.commore detailed DNS query
ping <dns-server-ip>test reachability to the DNS server

Example compare-by-name vs compare-by-IP

ping 1.1.1.1
nslookup github.com
curl -I https://140.82.121.4
curl -I https://github.com

This kind of sequence helps separate:

  • raw IP connectivity
  • DNS resolution
  • app behavior by direct IP vs by hostname

Verification

CheckExpected result
Resolver config existsat least one sensible DNS server is configured
DNS query worksnslookup or dig returns an answer
DNS server reachablehost can reach the configured DNS server
App by name works againconfirms DNS path is healthy

Pitfalls / Troubleshooting

ProblemLikely causeWhat to check
ping 8.8.8.8 works but names failDNS-only issueresolver settings, DNS server, lookup results
Names resolve slowlyslow or unhealthy DNS serverquery timing, alternative DNS server
Some names work, others do notupstream resolver or record issuecompare multiple domains, check query type
DNS config looks correct but app still failsapplication-specific issueapp logs, proxy settings, service config

Key takeaways

  • test raw IP first so you can separate routing from name resolution
  • check resolver configuration before assuming the DNS server is broken
  • nslookup and dig are often enough to narrow the issue quickly

Official standards