Blog · Essential Network Commands
Essential Network Commands cover

Essential Network Commands

The core commands used across Windows, Linux, and macOS for connectivity checks, DNS troubleshooting, routing visibility, and more.

Overview

The following outlines some Essential Network Commands used across Windows, Linux, as well as macOS.

There are various scenarios we may find ourselves in where any one of these commands can become beneficial. One of the most common is troubleshooting and diagnosing connectivity issues. Other scenarios include resolving DNS issues, addressing IP conflicts, or exploring how traffic flows through your network. The command line offers powerful tools to dive deeper into what may be going on.

This blog walks through several commonly used network commands that help uncover useful information such as IP configurations, DNS resolution, routing, active connections, network paths, and more. It’s based on material I put together in my Cross-Platform Network Commands tutorial, which is available through my GitHub Pages portfolio.

The goal is to offer a practical reference — especially for those getting started in IT — by sharing real examples and tools that are helpful in both personal labs and professional environments.

ping

Ping is the first responder on the network — it sends tiny data packets (ICMP echo requests) to a target IP or domain and waits for a reply, letting you verify that a device is reachable and measure how long the round-trip takes. It can be thought of as the digital equivalent of shouting “You there?” and listening for a reply.

Often the first command run when verifying connectivity...

ping output
Basic connectivity test using ping.

ipconfig / ipconfig /all · ifconfig / ip a

These commands reveal a given system’s IP configuration on the network. Whether you're using ipconfig on Windows or ifconfig / ip a on Linux, they display your interface’s IP address, subnet, gateway, and more — essential for understanding how your machine is plugged into the network.

Windows

Windows ipconfig /all output

Linux

Linux ifconfig output
Linux ip a output

Use these commands when you need to check your current IP address, default gateway, subnet mask, or DNS configuration. They're essential for diagnosing local network issues or verifying that a device is properly connected to the network.

arp -a

The arp -a command lets you peek behind the scenes of local communications by listing the Address Resolution Protocol (ARP) table. It maps IP addresses to MAC addresses — like your system’s contact book for nearby devices.

This command comes in handy when troubleshooting duplicate IP and MAC addresses or unauthorized devices on a network.

arp -a output

nslookup

The nslookup command is a Windows DNS investigation tool — it asks a DNS server for information about domain names and IP addresses. Whether you're hunting down where a website lives or diagnosing DNS failures, this command gives you a direct line to the domain name system.

Use this when you want to manually test if a domain resolves to the correct IP address or troubleshoot DNS server behavior. It’s a quick way to confirm whether DNS is functioning as expected.

nslookup output

host

Use this for quick domain-to-IP lookups or reverse lookups on Linux. It’s lightweight and ideal when you need fast, simple DNS resolution results without extra verbosity.

host output

dig

Best used when you need a deep look into DNS responses, query times, and authoritative answers. It’s the go-to tool for advanced DNS troubleshooting and validation.

dig output

netstat -a / netstat -an

The netstat command exposes a system’s open doors — it shows which ports are listening, which connections are active, and which processes are using them. Useful for identifying suspicious activity, verifying services, or seeing what active connections a given system has.

netstat output (Windows)
netstat output

tracert

Tracert (short for "trace route") is the Windows version of traceroute that traces the path packets take to reach a destination. It lists each network hop along the way, revealing delays, outages, or routing quirks that might be slowing things down.

tracert output

traceroute

The Linux cousin to tracert, traceroute traces the journey of packets through the internet. Each hop is revealed along the route to your target, helping you visualize where things slow down, drop, or take detours in the digital world.

traceroute output

pathping

pathping is a Windows command that combines ping and tracert into one — but with a twist. It sends pings to every hop along the path and calculates packet loss and latency at each point. It's the network path’s health report, not just its roadmap.

pathping output

The tracert, traceroute, and pathping commands are often used when you suspect network slowdowns, high latency, or unreachable services. They help identify which hop along the route is causing delays or drops.

route print · route -n / ip route

These commands unveil a system’s routing table — the rules it follows to decide where to send packets. route print on Windows and route -n, ip route on Linux give you a map of how traffic is directed across gateways and networks.

Windows

route print output

Linux

Linux routing table output

The route print, route -n, and ip route commands are useful in scenarios where you need to understand how traffic is routed on a given system or to verify the default gateway and routing rules. These are especially useful when diagnosing issues involving multiple network interfaces or incorrect network paths.

Takeaways

Mastering these Essential Network Commands equips you with the tools to confidently troubleshoot, investigate, and understand what's happening on a system or network whether you're working with Windows, Linux, or macOS. From verifying connectivity with ping, to mapping routes with tracert or traceroute, to inspecting DNS responses to active connections, these commands are foundational for anyone in IT, cybersecurity, DevOps or system/network administration.

While these tools may seem basic, they’re often the first place professionals turn when diagnosing issues — and knowing how to interpret their output can set you apart as someone who truly understands how networks function.

As you continue building your technical skills, revisit these commands in different scenarios, experiment with their options, and incorporate them into your troubleshooting workflow. The command line doesn’t just tell you what’s wrong — it teaches you how systems behave under the hood.

Thanks for reading — and feel free to explore the full hands-on version of this guide in my Cross-Platform Network Commands on GitHub, or visit more technical write-ups on my GitHub Pages Portfolio.

Back to Home