Network issues are common; the symptoms vary; the actual cause is often somewhere unexpected. The systematic approach: narrow down where in the network the problem is, before guessing at fixes.
This page covers the diagnostic toolkit and the workflow.
When a network problem appears:
dig example.com
nslookup example.com
host example.com
dig is the most flexible:
dig example.com # A record
dig example.com AAAA # IPv6
dig example.com MX # mail
dig +trace example.com # show full resolution path
dig @8.8.8.8 example.com # specific resolver
If DNS doesn't resolve, that's the problem. If it resolves but to wrong IP, propagation or config issue.
ping <host>
ping6 <host> # IPv6
Basic round-trip test. If ping fails, host is unreachable or filtering ICMP. Many cloud networks block ICMP.
ping doesn't test application — just basic IP connectivity.
traceroute <host>
mtr <host> # combines ping + traceroute, continuous
Shows each hop. Useful for identifying where packets are lost or delayed.
mtr is more useful than traceroute for ongoing debugging — refreshes continuously.
nc -zv <host> <port> # check if port is open
telnet <host> <port> # interactive
nmap -p <port> <host> # more thorough
If port unreachable: firewall, security group, or service not listening.
ss -tnp # active connections
ss -tlnp # listening sockets
ss -s # summary
netstat -an | grep ESTAB # legacy version
Shows what's connected to what. Important for diagnosing connection-pool issues, port exhaustion, etc.
curl -v https://example.com
curl -I https://example.com # headers only
curl --resolve host:80:1.2.3.4 ... # override DNS
Verbose curl shows the full TLS handshake, headers, response. For HTTP-level issues, this is the workhorse.
curl --trace-ascii out.txt ... # full trace
For deep debugging.
tcpdump -i any -nn host <host>
tcpdump -i any -nn -w capture.pcap host <host>
Capture and analyze. The .pcap file opens in Wireshark for visualization.
For debugging issues that need to see actual packets — TCP retransmits, missing handshakes, malformed headers.
openssl s_client -connect host:443
openssl s_client -connect host:443 -servername sni.example.com
Tests TLS handshake. Useful for cert issues, SNI problems, protocol mismatches.
time curl -o /dev/null https://example.com — total timecurl -w '@curl-format.txt' ... — break down by phase
time_namelookup (DNS)time_connect (TCP)time_appconnect (TLS)time_starttransfer (TTFB)dig <host> — DNS works?ping <host> — IP reachable? (may be blocked)nc -zv <host> <port> — port open?curl -v https://<host> — application responds?If DNS fails, fix DNS. If port closed, fix firewall/security group. If application fails, server-side issue.
mtr for several minutes. Look for:
Often a network mid-path issue that's not your immediate infrastructure.
openssl s_client -connect host:443 -showcerts
Examine the cert chain. Common issues:
kubectl exec into pod, run standard toolskubectl logsip netnsLocal DNS resolver, application DNS cache, VPC resolver — may give different answers.
Browser cache, CDN cache, DNS cache. When debugging, work to bypass caches.
Web server logs don't show network errors. Application logs may not show TLS issues. Look at the right place for the right symptom.
Client clock vs. server clock matters for TLS (cert validity windows, JWT expiration).
Fragmented packets through tunnels. Ping with -M do -s 1472 to test path MTU.