Network Diagnostics Toolkit
Intermediate10 min
Diagnose network connectivity, DNS resolution, port availability, and routing issues using standard Linux networking tools.
Prerequisites
- -Linux shell access
Steps
1
Check network interfaces and IP addresses
View all network interfaces and their assigned IP addresses.
$ ip -brief addr
2
Test DNS resolution
Verify that DNS is resolving domain names correctly.
$ dig google.com +short
Use 'dig @8.8.8.8 domain.com' to test against a specific DNS server.
3
Check if a remote port is reachable
Test TCP connectivity to a specific host and port.
$ nc -zv example.com 443 -w 5
The -w flag sets a timeout. Use -u for UDP ports.
4
Trace the network path to a destination
See each network hop between you and the destination to identify where packets are being dropped.
$ traceroute -n example.com
5
Check listening ports
View all ports that are currently listening for connections.
$ ss -tlnp
-t for TCP, -l for listening, -n for numeric ports, -p for process names.
Full Script
FAQ
Discussion
Loading comments...