Introduction

Networking commands are essential tools used by network administrators and engineers to diagnose, configure, and troubleshoot network connectivity. This article explores the most commonly used networking commands with practical examples.

1. ping - Checking Network Connectivity

The ping command is used to test the reachability of a host on an IP network by sending ICMP Echo Request packets.

Example:

ping google.com

Output:

Reply from 142.250.74.206: bytes=32 time=10ms TTL=118

2. traceroute / tracert - Tracing Network Routes

traceroute (Linux/macOS) or tracert (Windows) displays the path packets take to reach a destination.

Example:

traceroute google.com  # Linux/macOS
tracert google.com     # Windows

3. ipconfig / ifconfig - Displaying IP Configuration

  • Windows: ipconfig displays network settings.
  • Linux/macOS: ifconfig (deprecated, use ip a) shows IP configuration.

Example:

ipconfig /all  # Windows
ifconfig       # Linux/macOS

Output:

IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

4. netstat - Viewing Network Connections

The netstat command provides detailed information about active network connections, listening ports, and routing tables.

Example:

netstat -an  # Display all active connections

5. nslookup - Querying DNS Records

nslookup is used to find the IP address of a domain name and troubleshoot DNS issues.

Example:

nslookup google.com

Output:

Server: 8.8.8.8
Address: 142.250.74.206

6. dig - Advanced DNS Queries

dig is a powerful DNS lookup tool available on Linux/macOS.

Example:

dig google.com

7. arp - Viewing ARP Cache

The arp command shows or manipulates the ARP table, which stores IP-to-MAC address mappings.

Example:

arp -a

8. route - Managing Routing Tables

The route command displays and modifies the routing table.

Example:

route -n  # Show routing table in Linux

9. hostname - Displaying Hostname

The hostname command prints the system’s hostname.

Example:

hostname

10. curl & wget - Fetching Web Content

  • curl and wget retrieve web content via HTTP/S.

Example:

curl -I https://www.google.com
wget https://www.google.com

Conclusion

Mastering networking commands is crucial for diagnosing and troubleshooting network issues. Understanding their output allows professionals to analyze network performance and resolve connectivity problems efficiently.