Fixing DNS and Web Errors

Ch. 4 of 518 mins3 Tasks

Differentiate between raw network IP reachability and Domain Name System resolution failures. Use nslookup and ping to pinpoint application layer breakdowns.

Track Series

Chapters in this Track (Ch. 4 of 5)

4Fixing DNS and Web Errors
18m

A widespread saying among enterprise systems administrators is: "It's not always DNS, but it's usually DNS." When users report that they cannot access corporate cloud portals, internal intranets, or public websites, non-technical staff assume the physical internet is disconnected. In reality, the physical wires, switches, and routers are frequently in perfect working order; only the name-to-address translation service has stopped functioning.

Humans depend on readable domain names like portal.company.local or google.com, but routers and switches forward packets exclusively using 32-bit binary IP addresses. When the Domain Name System (DNS) fails, computers are unable to translate the names into destination IPs, causing applications to fail instantly. In this chapter, you will learn how to isolate DNS resolution failures from IP transport problems.

The Two-Step Diagnostic Litmus Test

To determine in less than ten seconds whether an outage is caused by DNS or underlying network transport, network engineers perform a simple two-step test from the client terminal:

  1. Test 1: Ping a Known Public IP (e.g., ping 8.8.8.8): By pinging a raw numerical IP address, you completely bypass the DNS resolution process. If this ping succeeds, you have indisputable mathematical proof that Layers 1, 2, and 3 are 100% operational. The physical cable, local switch, default gateway, ISP connection, and internet routing are all functioning.
  2. Test 2: Ping a Domain Name (e.g., ping google.com): If Step 1 succeeds but Step 2 returns "Ping request could not find host," the fault is isolated exclusively to Layer 7 DNS configuration!
Ping 8.8.8.8 Result Ping Domain Result Identified Root Cause Immediate Recommended Action
Success (0% loss) Success (0% loss) Network and DNS fully operational Investigate local browser cache or user credentials
Success (0% loss) Failure ("Cannot find host") DNS Resolution Failure Check client DNS IP setting, query nslookup, test port 53
Failure (Timed out) Failure ("Cannot find host") Layer 1-3 Transport Failure Troubleshoot gateway, router routes, or ISP link

DNS Caching, TTL Expiration, and Hosts File Overrides

When troubleshooting client DNS problems, engineers must remember that operating systems maintain a local DNS Resolver Cache in RAM. If a website changes its IP address, client machines continue attempting to connect to the outdated IP address until the record's Time to Live (TTL) expires or the cache is manually cleared.

On Windows systems, running ipconfig /flushdns purges the local resolver cache, forcing the operating system to query the authoritative name server fresh. Furthermore, technicians should always inspect the local hosts file (located in /etc/hosts on Linux/macOS or C:WindowsSystem32driversetchosts on Windows). Stale manual entries left behind by previous software developers override all DNS lookups and frequently cause baffling single-machine connection failures.

Recursive versus Iterative DNS Queries

To pinpoint where DNS lookups fail, you must understand the distinction between Recursive Queries and Iterative Queries. A client computer issues a recursive query to its local resolver: "Please give me the IP address for this domain, or tell me it does not exist." The client expects a complete final answer.

The local DNS resolver then performs iterative queries across the global internet hierarchy: asking the Root Hint servers (.), followed by the Top-Level Domain servers (such as .com or .org), and finally querying the Authoritative Name Server for the specific domain. If any intermediate firewall blocks outbound UDP port 53 traffic from the local resolver, internal clients experience complete name resolution blackout.

Investigating DNS with nslookup

When you have confirmed a DNS fault, the primary diagnostic utility on Windows, Linux, and macOS is nslookup (Name Server Lookup). The command directly queries the configured DNS server for an A record:

C:> nslookup intranet.company.local
Server:  dns.company.local
Address:  192.168.1.250

Name:    intranet.company.local
Address:  192.168.1.100

If nslookup returns "DNS request timed out," verify the following common causes:

  • Typo in DNS Server IP: The workstation is configured with a non-existent DNS server IP address (such as 192.168.1.251 instead of .250).
  • DNS Server Down: The server hosting the BIND or Windows DNS service has crashed or its network interface is disabled.
  • Firewall Blocking UDP Port 53: A newly applied access control list or security rule on the gateway router is blocking UDP port 53 traffic between the client subnet and the DNS server.

Hands-On Lab Practice

In this lab exercise, you will diagnose a computer that can successfully ping external IP addresses but fails completely when trying to reach company web services by name. You will execute the two-step diagnostic litmus test, run nslookup to inspect the responding name server, identify the DNS IP misconfiguration on the workstation, correct the address, and restore full name resolution functionality.

Follow the checklist below. Confirm that both numerical and name-based queries return zero packet loss upon completing your repair.

Hands-On Practice Checklist

Progress:0 / 3

Perform actions on the practice lab canvas on the right. Tasks automatically check off as you connect cables and run commands.

Task 1: Execute Raw IP Reachability Test

From Client PC Terminal, ping raw IP 8.8.8.8. Confirm that underlying Layer 3 transport is 100% operational.

Task 2: Ping Local Company DNS Server

From Client PC Terminal, ping DNS Server at 192.168.1.250 to verify local server reachability.

Task 3: Verify End-to-End Web Server Access

From Client PC Terminal, ping Internal Web Server at 192.168.1.100. Confirm full communication.