Mission 23 of 30
Basic Networking Commands
Separate local configuration, name resolution, and remote connectivity checks.
Test connectivity, fetch web pages, inspect addresses, and understand DNS basics.
Practice inside
~/linux-practice. Check your setup before you begin.
Prerequisite: Ubuntu Package Management Safely
.
What you’ll practice
- Use ping
- Use curl safely
- Inspect IP addresses and routes
The mental model
- Network commands may contact external servers.
- Save downloads inside ~/linux-practice/downloads.
- Some tools may not be installed by default; skip optional installs.
Try it in your terminal
Connectivity checks
Read-only system viewSends ICMP probes to a public address and the local loopback interface. A reply is useful evidence; no reply is inconclusive because networks and hosts may block ICMP.
Run from ~/linux-practice
ping -c 2 8.8.8.8
ping -c 1 localhost Check DNS separately from connectivity
Read-only system viewSeparates name lookup from ICMP reachability. If the IP address replies but name lookup fails, DNS is the likely layer to investigate. A failed ping alone does not prove the network is offline.
Run from ~/linux-practice
getent hosts example.com
ping -c 1 example.com
ping -c 1 1.1.1.1 Fetch a web page
Safe in practice folderDownloads into the sandbox downloads folder. -L follows redirects; -I fetches headers only.
Run from ~/linux-practice
mkdir -p ~/linux-practice/downloads
cd ~/linux-practice/downloads
curl -IL https://example.com
curl -L -o example.html https://example.com
head -5 example.html Inspect network info
Read-only system viewViews addresses, routes, and listening ports.
Run from ~/linux-practice
ip addr show | head -30
ip route show
ss -tuln | head -20
hostname -I Put it into practice
- Download example.com into downloads and inspect the first lines.
Check your result
The checks identify which connectivity layer works.
Common mistakes
- You run `curl` and it works, forgetting that your request just traveled across the internet to a remote server. Network commands are not local — they contact external systems. Be deliberate about what you send and where.
- You try to install a missing tool with `sudo apt install` when the lesson works fine without it. If a command is optional, skip the install. You're learning concepts, not building a production system.
Check your understanding
Explain these in your own words. If you’re unsure, revisit the examples before moving on.
- What does ping -c 2 mean?
- Where should downloaded files go in this course?
Your practice, your pace
Loading saved progress…