Last updated: Apr 30, 2026

Network Diagnostic Tools

A few diagnostic tools that help to check whether a host is reachable, how traffic travels through the network, which ports are open, how DNS resolves, and what response a server returns.

Commands

ping - check if a host is reachable

ping sends small packets to a host and waits for a reply. It is useful for checking basic connectivity, for example when you are not sure whether the problem is with the network, browser, or application.

ping -c 4 8.8.8.8
ping google.com
ping6 2606:4700:4700::1111

traceroute - show the route to a host

traceroute shows the network hops between your machine and the destination. It helps to debug where a connection slows down or fails.

traceroute google.com  

On Windows the command is tracert.

netstat - inspect network connections

netstat netstat shows your active network connections, listening ports, and routing information.

nslookup - query DNS records

nslookup checks how a domain name resolves to an IP address. Useful for simple DNS debugging.

nslookup google.com

dig - detailed DNS lookup

dig is a more detailed DNS diagnostic tool. It can query specific record types, such as A, AAAA, MX, TXT, or CNAME

dig google.com

curl - make HTTP requests from the terminal

curl sends requests to URLs and prints the response. It is useful for checking APIs, headers, redirects, and server responses.

curl google.com
curl -I google.com         # show only response headers
curl -L google.com         # follow redirects
curl -X POST google.com -H "Content-Type: application/json" -d '{"name": "John"}' # send a POST request with JSON body