Skip to main content

CompTIA A+

Command Line Network Commands

11 min read

Graphical tools are helpful, but they don't always show the cause of a network failure. When the Wi-Fi icon looks fine and the browser still won't load, the command line gives direct evidence. For CompTIA A+ Core 2 (220-1202), Domain 1, Objective 1.5, you're expected to recognize common network commands and interpret their output.

This post focuses on the required tools: ipconfig, ping, tracert, pathping, nslookup, netstat, and net use. Each command answers a specific question, such as "Do I have a valid IP?" or "Where does the connection fail?" The examples are simple, Windows-focused, and safe to run on a home PC. You won't change settings unless you choose to run repair switches.

The goal is a repeatable method you can use on the exam and at the help desk.

Start with ipconfig to check your IP settings fast

When someone says "the internet is down," start by checking local addressing. ipconfig reads your network adapter settings and shows whether your PC can even attempt to reach other networks.

In Windows, a working connection usually means you have an IPv4 address (for many networks), a default gateway, and at least one DNS server. If any of those are missing or wrong, web browsing will fail even if the signal looks strong.

A few terms matter for both troubleshooting and the exam:

  • IPv4: The common dotted address format, like 192.168.1.20.
  • IPv6: A longer address format that many networks also use.
  • Default gateway: The router address your PC uses to reach other networks.
  • DNS server: The system that translates names (like example.com) into IPs.
  • DHCP: The service that automatically gives out IP settings.
  • Link-local (169.254.x.x): A self-assigned IPv4 address, often a sign that DHCP failed.

A quick flow that works in real tickets:

  1. Run ipconfig and check the IPv4 address, gateway, and DNS.
  2. If you see 169.254.x.x, suspect DHCP or a disconnected network.
  3. Renew the lease (covered below), then re-check ipconfig.
  4. Retest with ping after the IP looks sane.

macOS and Linux show similar information, but they use different commands (often ifconfig or ip). For Core 2, stay fluent in the Windows output.

ipconfig, ipconfig /all, and what the key lines mean

ipconfig gives a short snapshot. It usually shows the IPv4 address, subnet mask, default gateway, and sometimes IPv6 details. That's enough to spot obvious failures, such as a missing gateway.

ipconfig /all adds the identity and the "why" behind the settings. Several lines are high-value for the exam:

  • Physical Address: Your MAC address. It identifies the network card on the local network.
  • DHCP Enabled: "Yes" means the PC expects DHCP to supply settings.
  • Lease Obtained / Lease Expires: The timeframe for the current DHCP lease.
  • DNS Servers: The resolvers the PC will ask for name lookups.
  • Default Gateway: Your exit toward the internet or other subnets.

Quick interpretation examples help you move fast:

  • If you have a valid IPv4 address but no default gateway, the PC often can't route off the local network.
  • If the DNS server line is blank or points to an old device, names may fail even when IP pings succeed.
  • If DHCP is enabled but you have 169.254.x.x, the PC likely didn't reach the DHCP server.

A link-local address (169.254.x.x) is a clue, not a verdict. It can mean a bad cable, wrong Wi-Fi password, a down DHCP service, or a blocked port.

Fix common IP problems with /release, /renew, and /flushdns

When DHCP settings look wrong, ipconfig can also request a fresh lease. Three switches show up often in support scripts.

Use ipconfig /release to drop the current DHCP-assigned IPv4 address. Then run ipconfig /renew to ask the DHCP server for a new one. Success usually looks like a normal private IP (for example, 192.168.x.x) and a restored default gateway line.

A practical caution matters here: running /release can cut off network access until /renew works. If you're connected through a remote session, plan ahead, or you may lock yourself out.

ipconfig /flushdns clears the local DNS resolver cache. This helps when a site changed to a new IP, but your PC still tries the old one. After a flush, the next connection forces a fresh lookup through your DNS server.

In short, /renew fixes "no valid address" problems, while /flushdns fixes "the name points to the wrong place" problems.

Test reachability and the route with ping, tracert, and pathping

After your IP settings look reasonable, test reachability in layers. Think of it like checking a chain. If the first link is broken, later tests won't matter.

ping is the basic reachability tool. It sends small ICMP echo requests and measures the replies.

This lesson is part of ExamWizardz Pro

Unlock every lesson, unlimited practice tests, and the AI tutor.

See Pro pricing

or start with a free account