Operations 5 min read

Essential Linux Network Troubleshooting Commands You Must Know

This guide introduces the most useful Linux network troubleshooting commands—ping, traceroute, ifconfig/ip, netstat, nslookup/dig, curl/wget, and tcpdump—explaining their purpose, basic usage, and example outputs to help quickly diagnose and resolve connectivity issues.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Essential Linux Network Troubleshooting Commands You Must Know

Network problems are common on Linux systems, and mastering a set of diagnostic commands is crucial for administrators and users to quickly identify and fix issues such as connectivity failures, DNS problems, and latency.

ping command

The ping command sends ICMP echo requests to a target host to verify network reachability.

# Use ping command to test connectivity
ping example.com

Typical response shows the round‑trip time and packet details:

64 bytes from 93.184.216.34: icmp_seq=1 ttl=54 time=74.5 ms

traceroute command

traceroute

traces the path packets take to a destination, displaying each hop and its latency, which helps locate bottlenecks.

# Trace the route to a host
traceroute example.com

ifconfig / ip command

ifconfig

and ip reveal and configure network interface details such as IP address, netmask, and gateway.

# Show interfaces with ifconfig
ifconfig

# Show interfaces with ip
ip addr show

netstat command

netstat

displays active network connections, listening ports, and routing tables, providing a snapshot of the system's network state.

# List all listening sockets
netstat -tuln

# Show routing table
netstat -r

nslookup / dig command

Both nslookup and dig query DNS records to verify domain name resolution.

# DNS lookup with nslookup
nslookup example.com

# DNS lookup with dig
dig example.com

curl / wget command

curl

and wget test HTTP/HTTPS connectivity, showing response headers and status codes.

# Test HTTP response with curl
curl -I https://example.com

# Test HTTP response with wget
wget --spider https://example.com

tcpdump command

tcpdump

captures network packets on a specified interface, allowing deep inspection of traffic for troubleshooting.

# Capture packets on eth0
sudo tcpdump -i eth0

These commands together form a practical toolkit for diagnosing and resolving a wide range of Linux network issues, improving reliability and reducing downtime.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

networkLinuxSysadmincommands
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.