DNS Resolution Troubleshooting

Network Troubleshooting

Chapter 4 · DNS Resolution Troubleshooting

Local connectivity confirmed in Chapter 3 means this machine can reach its gateway and, through it, the rest of the network. The next rung, per Chapter 2's ladder, is DNS: does the name the user is actually typing resolve to the IP address it's supposed to? This chapter covers the two tools that answer that question, the handful of failure patterns that cover almost every real DNS ticket, and one technique — bypassing local DNS entirely — that's often the single fastest way to tell a local infrastructure problem apart from a genuine, global DNS issue.

How Resolution Actually Happens

When a name is looked up, the request doesn't necessarily go out to "the internet" fresh every time. It typically passes through several layers, any of which might already hold — or wrongly hold — an answer: the application's own cache, the operating system's resolver cache, the configured DNS server (often a local corporate resolver), and only then, if nothing already has an answer, a chain of recursive lookups out to the authoritative servers for that domain. Every one of those layers can cache a result for a period of time set by that record's TTL (time to live) — which matters a great deal diagnostically, and gets its own warning later in this chapter.

Two Tools, One Underlying Answer

ToolPlatformNotes
nslookupWindows (also available on Linux/macOS)Simple, widely available, but its plain-English phrasing hides the underlying DNS response code
digLinux, macOSMore verbose, shows the actual DNS response status directly (NOERROR, NXDOMAIN, SERVFAIL, etc.)
Resolve-DnsNameWindows PowerShellPowerShell's own modern equivalent, with structured output — worth knowing if you've been through this site's own PowerShell Fundamentals course
Same underlying answer, genuinely different-looking output
A single DNS response code can look completely different depending on which tool reports it. A name that doesn't exist produces a literal status: NXDOMAIN line in dig's output, but shows up in nslookup as a plain-English sentence: "can't find ... : Non-existent domain." Recognizing that both are reporting the exact same underlying DNS failure — not two different problems — matters more than memorizing either tool's specific wording.

Reading a Healthy Resolution

C:\> nslookup app.example.com Server: dns.corp.example.com Address: 10.0.0.53 Non-authoritative answer: Name: app.example.com Address: 203.0.113.42

Two things worth noting even in a healthy result: which server answered (dns.corp.example.com here — the locally configured resolver, not necessarily the domain's own authoritative server), and that the answer is marked "non-authoritative" — meaning it came from a cache somewhere along the chain, not fresh from the domain's own DNS servers. Neither is a problem on its own; both become relevant the moment the answer looks wrong.

The Four Failure Patterns

PatternWhat it means
NXDOMAINThe name genuinely doesn't exist as far as this DNS server knows — a typo, a domain that was never registered, or a record that was deleted
SERVFAILThe DNS server tried to answer and failed — often a misconfigured zone on the authoritative server, or a DNSSEC validation failure; the name might be entirely valid
Timeout / no responseThe DNS server itself couldn't be reached at all — this is actually a network-reachability problem to the DNS server, not a DNS problem in the strict sense
Resolves, but to an unexpected IPOften a stale cached answer that hasn't expired yet, or a genuine split-horizon DNS setup returning a different, equally "correct" answer depending on where the query came from
$ dig app.example.com ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4821 ;; QUESTION SECTION: ;app.example.com. IN A ;; AUTHORITY SECTION: example.com. 3600 IN SOA ns1.example.com. admin.example.com.

The line to look for is always status: — in dig's output it's stated explicitly, which is exactly why it's the more useful tool once you already suspect a DNS problem rather than just doing a routine lookup.

Bypassing Local DNS to Isolate the Problem

One of the most useful single techniques in this chapter: query a known public DNS server directly, instead of whatever's configured by default, and compare the two answers.

$ dig app.example.com +short 203.0.113.77 $ dig @8.8.8.8 app.example.com +short 203.0.113.42

Two different answers for the same name is a genuinely strong signal: the local resolver is holding a stale or otherwise incorrect answer, while the public internet's view of that domain is already correct — or, less often, the reverse, if a change was only made locally and hasn't propagated out yet. Either way, this single comparison usually tells you within seconds whether the problem is specific to local DNS infrastructure or a real, global issue with the domain itself.

"It's fixed" doesn't mean everyone sees it fixed yet
A DNS record has a TTL — a length of time other resolvers are allowed to keep serving their own cached copy of it before checking again. Updating a record doesn't retroactively update every cache that already has the old answer; those caches keep serving the stale value until their own TTL expires. "I already fixed it" and "the user still can't reach it" are both true at the same time far more often than it seems like they should be — this isn't a sign the fix didn't work, it's the TTL doing exactly what it's designed to do.
Split-horizon DNS: two correct answers, not one wrong one
Some organizations deliberately configure DNS to return different answers depending on where the query comes from — an internal IP for requests from inside the corporate network, a public IP for everyone else. A ticket like "it works from home but not from the office" (or the reverse) can be exactly this working as designed, not a fault at all. Worth ruling in or out early, since chasing it as a bug wastes real time on something that isn't broken.

Working Example: Continuing the Ticket

The ticket from Chapters 1–3 continues: local connectivity confirmed, so the ladder moves to DNS. nslookup app.example.com from the user's machine returns 203.0.113.77 — but a quick dig @8.8.8.8 app.example.com +short from your own machine returns 203.0.113.42, a different address. That mismatch alone is the finding: this user's local DNS resolver is serving a stale answer, most likely a caching issue on the corporate resolver or a TTL that hasn't yet expired since a recent change. The fix belongs to DNS infrastructure, not the application — and the ladder can move to Chapter 5 once a correct answer is confirmed, to check whether the right IP is actually reachable.

Hands-On Exercises

Exercise 1

A colleague sees an nslookup failure message and a dig failure message that look completely different and assumes they're two different problems. Explain why this chapter says that assumption can be wrong, using the specific example from this chapter.

📄 View solution
Exercise 2

Explain what it means when dig app.example.com +short and dig @8.8.8.8 app.example.com +short return two different IP addresses, and why running both is more useful than running only the first one.

📄 View solution
Exercise 3

A user says "you told me this was fixed yesterday, but I still can't reach it correctly." Explain two genuinely different, non-buggy explanations from this chapter that could both make this true at the same time.

📄 View solution

Chapter 4 Quick Reference

  • nslookup (Windows/cross-platform) and dig (Linux/macOS, more verbose) both report the same underlying DNS response — just phrased differently
  • Four failure patterns: NXDOMAIN (doesn't exist), SERVFAIL (server-side failure), timeout (DNS server unreachable — a network problem, not a DNS problem), wrong-looking answer (stale cache or split-horizon)
  • Bypass local DNS — query a public resolver directly (dig @8.8.8.8 ...) and compare — a fast way to isolate local DNS infrastructure from a genuine global issue
  • TTL means a fix isn't instantly visible everywhere — stale caches keep serving the old answer until their own TTL expires, by design
  • Split-horizon DNS can make "different answer from a different location" correct behavior, not a bug
  • Next chapter: Testing the Path: ping and traceroute/tracert — What They Actually Prove