Networking Essentials (ping, netstat, ss)

Ubuntu: Networking Essentials (ping, netstat, ss)

Networking tools are essential for diagnosing connectivity issues and monitoring server traffic. This guide explains how to use ping, netstat, and ss on Ubuntu servers.


Step 1: Test Connectivity with ping

ping google.com

Sends ICMP packets to check if a host is reachable.

ping -c 4 8.8.8.8

Sends 4 packets to Google’s DNS server.


Step 2: Check Active Connections with netstat

sudo netstat -tulnp

Displays all active TCP/UDP connections and listening ports.

sudo netstat -an | grep ESTABLISHED

Shows established connections only.


Step 3: Use ss for Socket Statistics

ss -tulwn

Lists all listening ports with protocol details.

ss -s

Displays a summary of socket statistics.


Step 4: Trace Network Routes

traceroute google.com

Shows the path packets take to reach a destination (install with sudo apt install traceroute -y).


Step 5: Check DNS Resolution

dig hostpalace.com

Queries DNS records for a domain (install with sudo apt install dnsutils -y).


Best Practices

  • Use ping to quickly test connectivity
  • Use netstat or ss to check open ports and active connections
  • Monitor suspicious connections regularly
  • Combine with firewall rules (UFW) for better security

Note: HostPalace servers are globally connected, and these tools help clients troubleshoot and secure their networking effectively.