Debug your connection.
/nw is a command-line tool that tests how your network reaches a site or server, one layer at a time. It tells you what the results show and what they do not prove. It runs on your machine and uploads nothing.
$ nw diagnose example.com Summary dns ok tcp ok tls ok http ok No actionable findings. ok dns example.com via system 24.1 ms ok tcp 203.0.113.10:443 11.8 ms ok tcp [2001:db8::10]:443 12.6 ms ok tls 203.0.113.10:443 39.4 ms ok tls [2001:db8::10]:443 41.0 ms ok http https://example.com/ (ipv4) 96.7 ms ok http https://example.com/ (ipv6) 98.2 ms $
$ nw diagnose example.test:8443 Summary dns ok tcp ok tls FAIL http skipped Problem found: 1 error, 0 warning, 0 informational. FAIL tls 203.0.113.7:8443 (example.test) tls.cert_expired: the certificate is expired or not yet valid skip http https://example.test:8443/ (ipv4) Hypotheses (possible explanations, not conclusions) h-001 medium confidence The certificate expired and was not renewed, or this machine's clock is wrong not observed: the clock was not compared with a trusted source $
$ nw diagnose example.com Summary dns ok tcp partial tls ok http ok No actionable findings. 1 informational. ok tcp 203.0.113.10:443 FAIL tcp [2001:db8::10]:443 tcp.unreachable: no route to [2001:db8::10]:443 INFO IP_FAMILY_BEHAVIOR_DIFFERENCE ipv4 works and ipv6 fails at the tcp layer h-001 high confidence This network has no IPv6 connectivity, which is normal and not a fault of the destination $
$ nw doctor --region ir Where the problem is local ok domestic reachable international UNREACHABLE International reference targets are unreachable while the local checks and the domestic targets pass. ERROR INTERNATIONAL_UNREACHABLE 3 of 3 international reference targets did not answer (http.timeout) Hypotheses (possible explanations, not conclusions) h-001 medium confidence Traffic to international destinations is dropped or stalled beyond this machine; domestic ones work not observed: where on the path the traffic stops $
example output
$ curl -fsSL https://nwrk.ir/install.sh | sh> irm https://nwrk.ir/install.ps1 | iex$ go install github.com/hesamzakerirad/nwrk/cmd/nw@latestSigned releases start at v0.1.0. Until then, use Go.
Every layer, in order
/nw tests DNS, TCP, TLS and HTTP in that order. If one layer fails, it skips the layers after it and tells you why. You see where the connection breaks, not just a generic error.
- your machine+0 ms
Starting point. Nothing is sent until the first layer runs.
- dns ok+24 ms
Asks the system resolver, and any resolver you choose, for A and AAAA records.
- tcp ok+36 ms
Connects to each address. IPv4 and IPv6 are tested separately.
- tls FAIL+78 ms
Checks the certificate chain and the server name. Certificate checks are always on.
tls.cert_expired - http skipped
Sends one request with a time limit and times each stage.
- example.com
Commands for common network problems
Start with the question you have. Each command answers one.
A site won't load. Where does it break?
$ nw diagnose example.comTests DNS, TCP, TLS and HTTP in order and names the layer that failed.
Is it my network, my country or the site?
$ nw doctor --region irChecks this machine first, then reference sites for a region. Tells you whether the problem is local, in your country or international.
Is something on the path tampering with my connection?
$ nw security interference example.comCompares resolvers, TLS handshakes by server name, and http with https. Lists other possible causes for each difference.
Is my DNS server the problem?
$ nw test dns example.com --resolver tls://9.9.9.9Runs a single measurement. A resolver can be plain, tcp://, tls:// or https://.
Where do my packets stop?
$ nw path trace example.comPing, trace and MTU hints. Uses ICMP where allowed and TCP where not.
How does this machine connect?
$ nw network showLists your interfaces, routes, DNS servers and proxies. Sends nothing.
Evidence, not guesses
From one machine, a timeout and a block can look identical. /nw reports what it measured, what could explain it, and what it did not check.
- finding
- What was observed, such as tls.cert_expired. The same measurements always give the same finding.
- hypothesis
- A possible explanation, such as an expired certificate or a wrong clock on your machine. It is labeled as a possibility, never as a conclusion.
- not observed
- Every hypothesis lists what was not checked, so you know what to test next.
- confidence
- One measurement is never enough for high confidence.
What /nw will not do
Everything runs on your machine. These limits are fixed, not settings.
- Upload anything. There is no account, no server and no telemetry.
- Skip certificate checks, or record cookies, page bodies or credentials.
- Change your system. It does not touch DNS settings, proxies, firewall rules or routes.