Terminal Commands
GUIs change; the terminal endures. The first thing anyone troubleshooting a network opens is a command line — in this lesson you'll learn when and how to use the five essential commands, then try them in the simulator right below.
01The five essentials
| Command | Answers the question | Example |
|---|---|---|
ping | Can I reach the target? | ping google.com |
traceroute | Which path am I taking, where does it stall? | traceroute google.com |
nslookup | What's this name's IP? Is DNS working? | nslookup google.com |
ipconfig / ifconfig | What are my own network settings? | ipconfig |
netstat | Which connections do I have open? | netstat -an |
ping — the connectivity test
ping google.com
Sends a small packet (ICMP echo) to the target and waits for a reply. Watch two things in the output: time (latency, ms) and packet loss. If ping works, your physical link and routing are sound.
traceroute — the road map
traceroute google.com (on Windows: tracert)
By sending packets with increasing TTL values, it makes every router along the path identify itself. If there's a problem, it shows which hop it starts at: your home router, your ISP, or the far end?
nslookup — the DNS query
nslookup google.com
Tests name resolution. The classic diagnostic for "the site won't load but pinging the IP works": the problem isn't the network, it's DNS.
ipconfig / ifconfig — your own settings
ipconfig (Windows)
ifconfig (Mac/Linux)
Shows your IP address, subnet mask, and gateway. Step one of troubleshooting is always "who am I?": an IP like 169.254.x.x means you never got an address from DHCP.
netstat — open connections
netstat -an
Lists active connections and listening ports on your device. Use it to see which application is talking to where.
02The troubleshooting sequence
The order professionals follow for network problems:
ipconfig— do I have an IP, and is it sane?ping 192.168.1.1— can I reach my gateway? (local network test)ping 8.8.8.8— can I get out to the internet? (routing test)nslookup google.com— do names resolve? (DNS test)traceroute— still broken? Find out where.
These five steps diagnose 90% of "my internet is down" complaints.
03Try it now
The terminal below behaves like a real shell but runs entirely in your browser — no command touches your machine or any real network. Walk through the sequence above:
04Visual comparison
To see what the numbers in those outputs actually mean, explore ping and traceroute in visual form too:
Sandbox · CommandPing & TracerouteCompare latency, loss, and hop counts across destinations, side by side.Open tool05Summary
pingtests reachability,traceroutethe path,nslookupDNSipconfigshows your own settings,netstatyour open connections- Troubleshooting order: your IP → gateway → internet → DNS → path