Sachin Chaurasiya

Toolbox · Networking

Network Troubleshooting

Connectivity, DNS, ports, routing and packet capture from a Linux host or debug container.

Last reviewed
2026-09-18
On this page

Is it up? Is it reachable?

CommandPurpose
ping -c 3 hostICMP reachability (may be blocked)
nc -zv host 443TCP port check
curl -sv --connect-timeout 3 https://host/ -o /dev/nullFull HTTP(S) handshake with timing
curl -w '%{time_namelookup} %{time_connect} %{time_appconnect} %{time_starttransfer}\n' -o /dev/null -s https://host/Latency breakdown
traceroute -T -p 443 host / mtr -T -P 443 hostPath with TCP probes

DNS

CommandPurpose
dig +short A host / dig AAAA hostResolve
dig @1.1.1.1 host +traceFull delegation trace
dig -x 203.0.113.10Reverse lookup
resolvectl status / cat /etc/resolv.confResolver config
nslookup host 10.96.0.10Query a specific server (cluster DNS)

Local sockets and routes

CommandPurpose
ss -tulpnListening ports with process
ss -tnp state established '( dport = :5432 )'Connections to a port
ip addr / ip -br linkInterfaces
ip route get 8.8.8.8Which route/interface is used
ip neighARP table
sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_maxConntrack entries vs limit (exhaustion)

Firewalls and policy

CommandPurpose
sudo iptables -S / sudo nft list rulesetHost firewall rules
sudo iptables -t nat -L -n -vNAT rules (kube-proxy)
kubectl get networkpolicy -AKubernetes policies

Capture

CommandPurpose
sudo tcpdump -ni eth0 'tcp port 443 and host 203.0.113.10' -c 50Capture to screen
sudo tcpdump -ni any -w /tmp/cap.pcap 'port 53'Write pcap for Wireshark
kubectl debug -it <pod> --image=nicolaka/netshoot --target=appCapture inside a pod’s netns

See also