Course contents

Unit 14: Network TroubleshootingLesson 14.8 (8 of 10 in this unit)100 of 104 in the Network Fundamentals course

DNS problems

When the network works but names don't: how to prove it and fix it.

Beginner · 6 min read

Covers Name vs. IP test, Resolver settings and nslookup.

Technical definition

A DNS (Domain Name System) problem is a fault in name resolution: hosts can be reached by IP address, but names fail or resolve to the wrong address because of a wrong or unreachable DNS server, a wrong record or a stale cache. Testing the same destination by IP address and by name separates a DNS fault from a connectivity fault.

“The internet is down”, but chat still works

“The internet is down!” says a user. But their chat app is still connected, and you can ping a public IP address from their PC. The browser just shows “server not found” for every site. The network is fine. The PC simply can't translate names into IP addresses.

What DNS does, and what breaks

DNS (Domain Name System) translates a name such as www.example.com into an IP address. Your PC sends the question to a DNS resolver: the DNS server set in its network settings, usually provided by DHCP. If that step fails, almost every app fails with it, which is why DNS faults look like “everything is down”.

Step 1 of 3 · Query
Name first, then the connection
PC
IP 192.168.10.40
DNS resolver
IP 192.168.10.5
Web server
IP 203.0.113.80

Device key: PC (laptop) · DNS resolver (server)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • PC: IP 192.168.10.40
  • DNS resolver: IP 192.168.10.5
  • Web server: IP 203.0.113.80

Why the "IP versus name" test proves it

Ping the same destination twice: once by IP address, once by name. The two results together tell you where the fault is.

Diagram
Why the "IP versus name" test proves it
Why the "IP versus name" test proves it
Ping by IPPing by nameConclusion
WorksWorksThe network and DNS are fine. Look at the application.
Works"could not find host"DNS problem.
FailsFailsA network problem. Fix that before you look at DNS.
FailsName resolves to an address, then times outDNS works. The problem is the path or the target (or ICMP is filtered).
Read each row across: the left box names the item, the others describe it.
Diagram
Three common DNS faults
Three common DNS faults
✕ link downPCSW1Office DNSIP 192.168.10.5R1Old DNS192.168.99.5 (removed)

Device key: PC (laptop) · SW1 (switch) · Office DNS, Old DNS (server) · R1 (router)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type. Blocked: forwarding prevented by a port or policy. Down: failed link. Read the step for the cause.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Office DNS: IP 192.168.10.5
  • Old DNS: 192.168.99.5 (removed)
  1. 1. Wrong server: the PC was set by hand to use a DNS server that no longer exists. Every query times out.
  2. 2. Server down or blocked: the right server is set, but the DNS service has stopped, or a firewall blocks UDP and TCP port 53.
  3. 3. Stale or wrong record: DNS answers, but with an old address, either from the server or from the PC's own cache.

Reading nslookup errors and checking the resolver

Example output · typical of Windows, written for this lesson, not captured from a real computer
C:\> nslookup www.example.com
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  192.168.99.5

DNS request timed out.
    timeout was 2 seconds.
*** Request to UnKnown timed-out
What to look for: Address: 192.168.99.5 is the DNS server the PC is asking, and DNS request timed out means it doesn't answer. (Server: UnKnown only means nslookup couldn't look up that server's own name.) Compare the address with the DNS server listed in ipconfig /all and with what it should be.
nslookup www.example.com 192.168.10.5

Ask a specific DNS server. If this works but the default one doesn't, the PC is set to use the wrong server.

Example output · typical of Windows, written for this lesson, not captured from a real computer
C:\> nslookup nosuchhost.example.com 192.168.10.5
Server:  dns1.example.com
Address:  192.168.10.5

*** dns1.example.com can't find nosuchhost.example.com: Non-existent domain
This is different: the server answered, and the answer is “that name does not exist” (NXDOMAIN). The DNS server works, so check the spelling of the name, and whether the record was ever created.

On Linux and macOS, dig www.example.com gives more detail, and resolvectl status (Linux) or scutil --dns (macOS) shows which DNS resolver is in use. After a record is fixed, clear old answers from the PC's cache with ipconfig /flushdns on Windows or resolvectl flush-caches on Linux with systemd-resolved. A DNS resolver that cached the old answer keeps it until the record's TTL (time to live) expires, unless its cache is cleared too.

After a server move, the classic complaint is “it works for some people and not others”. That pattern usually means some PCs or resolvers still hold the old answer in their cache, not that the new record is wrong.

A Cisco router needs DNS too, for example to ping a device by name. The commands below are based on Cisco documentation, not run on a lab device.

Example output · based on Cisco documentation; exact format varies by platform and software version
R1(config)#ip name-server 192.168.10.5
R1(config)#ip domain lookup
R1(config)#end
R1#ping www.example.com
Translating "www.example.com"...domain server (192.168.10.5) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 203.0.113.80, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/11/12 ms
What to look for: domain server (192.168.10.5) [OK] shows that the router asked 192.168.10.5 and got an answer, and the ping went to the resolved address 203.0.113.80. ip domain lookup is on by default; if it has been turned off, the router can't resolve any names.

Test yourself on DNS faults

Predict · scenario 1

From a user's PC, ping 203.0.113.80 works, but ping www.example.com says 'could not find host'. Where is the fault?

Predict · scenario 2

A user can't open a new intranet site. nslookup gets 'Non-existent domain' from your normal DNS server. What does that tell you?