🔍
👶 Kids📝 Blog About Contact 🚀 Get Started Free

Network Troubleshooting & Tools

Master the essential command-line tools and techniques used to diagnose, analyze, and repair network connectivity issues.

The Troubleshooting Methodology

When solving network problems, a structured approach is essential. Most engineers troubleshoot by using the OSI Model, starting at Layer 1 (Physical check: Is the cable plugged in?) and working up to Layer 7 (Application check: Is the server running?).

Essential Command-Line Tools

These commands are built into Windows, macOS, and Linux terminal environments and are the first line of defense for network diagnostics:

1. ping

Sends ICMP Echo Request packets to a target IP or domain and waits for an Echo Reply. Used to verify basic connectivity and measure round-trip time latency.

$ ping google.com
Reply from 142.250.190.46: bytes=32 time=14ms TTL=117
  • No reply? Either the target is offline, network routing is broken, or a firewall is blocking ICMP packets.

2. traceroute / tracert

Shows the exact path (list of routers) a packet takes to reach a destination. It lists each "hop" and the latency for that hop. (Called tracert on Windows, traceroute on Linux/macOS).

$ traceroute google.com
1  192.168.1.1 (1.2ms)
2  10.0.0.1 (5.4ms)
3  203.0.113.5 (12.1ms)
4  142.250.190.46 (14.5ms)
  • Helps identify exactly which router along the path is failing or causing latency.

3. nslookup / dig

Queries DNS servers to resolve a domain name to an IP address. Used to diagnose DNS lookup issues.

$ nslookup codescompiler.com
Server:  1.1.1.1
Address: 1.1.1.1#53

Name:    codescompiler.com
Address: 104.21.75.122

4. ipconfig / ifconfig / ip addr

Displays the network configuration of your local network adapters, including IP address, subnet mask, and default gateway.

  • Windows: ipconfig (use ipconfig /release and ipconfig /renew to reset DHCP leases)
  • Linux/macOS: ifconfig or ip addr

5. netstat / ss

Displays active TCP connections, listening ports, and routing tables on your local machine. Great for finding out what applications are using the network.

$ netstat -an | grep 8080
TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING

Advanced Packet Sniffers & Analyzers

Wireshark

A graphical packet analysis tool (packet sniffer). It captures network traffic flowing through a network interface card and decodes the packet frames into human-readable layers. Used for deep protocol analysis and application troubleshooting.

tcpdump

A lightweight, command-line packet sniffer for Unix-like systems. Essential for capturing traffic on remote head-less servers and saving it to `.pcap` files for later analysis in Wireshark.

Common Network Issues & Solutions

  • "Limited or No Connectivity" (IP is 169.254.x.x) — This is an APIPA (Automatic Private IP Addressing) address. It means your computer could not contact a DHCP server to get an IP address. Check the DHCP server or cables.
  • Can Ping IP, but cannot open website by Name — This indicates a DNS failure. Your DNS server is either offline or misconfigured. Change your DNS server to 1.1.1.1 or 8.8.8.8 to test.
  • Duplicate IP Address Error — Two devices on the same LAN were assigned the same IP. Usually happens due to static IP misconfigurations overlapping with the DHCP pool.

What's Next?

Learn how DNS works to prevent name resolution issues in DNS Explained, or check out how IP addressing systems are designed in IP Addressing & Subnetting.