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.

40–50 min Week 3 · Productivity, storage, packages, networking Ubuntu terminal
Your outcome: Network commands feel like diagnostics, not hacking tools.
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 view

Sends 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 view

Separates 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 folder

Downloads 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 view

Views 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

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

  1. What does ping -c 2 mean?
  2. Where should downloaded files go in this course?

Your practice, your pace

Loading saved progress…

Discussion

Continue the conversation about this guide. Loading comments connects to GitHub Discussions through giscus.

Open community discussions on GitHub

Check before you copy

This command needs care. Read its context, confirm the target and location, and keep a recovery path.

Copying does not run a command.