Network Commands
Summary
This note is a quick reference for common commands used in basic network checking and troubleshooting.
When to use this note
- when you need a fast connectivity or DNS check
- when you want to separate address, path, and name resolution problems
- when you need quick syntax without opening a full troubleshooting guide
Address and route checks
| Command | Purpose |
|---|
ip addr | show interface addresses |
ip route | show route table and default route |
ip link | show interface state |
Reachability checks
| Command | Purpose |
|---|
ping <host> | test basic reachability |
traceroute <host> | show the path to a destination |
Name resolution checks
| Command | Purpose |
|---|
nslookup <name> | test basic DNS resolution |
dig <name> | query DNS in more detail |
Example sequence
ip addr
ip route
ping 1.1.1.1
nslookup example.com
dig example.com
Notes
ping helps answer “can I reach it?”, not “is the application healthy?”
ip route is one of the fastest ways to check whether the host has a sensible default route
nslookup and dig are useful when names fail but raw IP tests still work
Common mistakes
- assuming
ping success proves the application is healthy
- checking DNS first when the host has no usable route or interface state
- forgetting to test by raw IP as well as by name