Operations 13 min read

Essential Linux Networking Commands Every DevOps Engineer Should Master

This article provides a comprehensive, step‑by‑step guide to the most important native Linux networking commands—such as hostname, host, ping, curl, ip, ss, traceroute, dig, and tcpdump—explaining their purpose, common usage examples, and key options for effective system and network troubleshooting.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Essential Linux Networking Commands Every DevOps Engineer Should Master

Network configuration, diagnostics, and general Linux troubleshooting are essential for system administration. This guide lists the most important native Linux networking commands for developers, DevOps engineers, and SREs.

hostname

Displays or sets the system's host name. hostname Set a new host name with:

hostnamectl set-hostname aliyun01-2c2g40g3m

host

Performs DNS lookups, both forward and reverse.

host 8.8.8.8
host flashcat.cloud

ping

Checks reachability of a remote host and reports packet loss, round‑trip time, etc.

bytes sent/received

packets sent/received/lost

approximate round‑trip time in ms

ping <IP or DNS>
ping flashcat.cloud
ping 8.8.8.8

Limit the number of echo requests with -c:

ping -c 10 flashcat.cloud

curl

Transfers data from or to a server and can be used for network debugging across many protocols.

curl -v telnet://192.168.33.10:22
curl ftp://ftptest.net
curl https://flashcat.cloud

wget

Retrieves files from the web and can test proxy or server availability.

wget -e use_proxy=yes http_proxy=<proxy_host:port> http://externalsite.com
wget flashcat.cloud

ip (ifconfig)

Shows and manipulates routing and network interfaces; replaces the older ifconfig. ip addr Get IP of eth0:

ip a | grep eth0 | grep "inet" | awk -F" " '{print $2}'
ip show eth0
ip route
ip route list

arp

Displays the ARP cache mapping IP addresses to MAC addresses.

arp

ss

Modern replacement for netstat, provides socket statistics quickly. ss | head -n 5 Filter by protocol:

ss -ta
ss -ua
ss -xa

List listening sockets: ss -lt List established connections:

ss -t -r state established

traceroute

Shows the path packets take to a destination.

traceroute google.com

mtr

Combines ping and traceroute for real‑time network diagnostics. mtr google.com Generate a report with 10 packets:

mtr -n --report google.com

dig

Queries DNS servers for any record type. dig twitter.com ANY Short output: dig google.com ANY +short Specific record types:

dig www.google.com A +short
dig google.com CNAME +short
dig google.com MX +short
dig google.com TXT +short
dig google.com NS +short

Reverse lookup:

dig -x 8.8.8.8

nslookup

Another DNS lookup tool similar to dig.

nslookup google.com
nslookup 8.8.8.8
nslookup -type=any google.com

nc (netcat)

Swiss‑army‑knife for networking; can test port connectivity.

nc -v -n 192.168.33.10 22

telnet

Tests TCP connectivity to a specific port.

telnet 10.4.5.5 22

route

Displays and manipulates the kernel routing table.

route
route -n

tcpdump

Captures network packets for analysis.

sudo tcpdump --list-interfaces
sudo tcpdump -i eth0
sudo tcpdump -i eth0 -c 10
sudo tcpdump -i any

lsof

Lists open files; useful for finding which process holds a port.

lsof
lsof -i :8080
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.

DevOpsLinuxtroubleshootingNetworkingcommands
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.