Test if a host and port are reachable on Mac
Check TCP connectivity to any server, useful for firewall debugging.
Replace example.com and 443 with your host and port, then run the command. 'succeeded!' means the TCP port is open and reachable.
01Command
Command
$ nc -vz example.com 44302What it does
nc (netcat) opens a raw TCP connection to the host and port, then closes it. -v prints the result and -z means 'scan only, send no data'. If it hangs or fails, the port is blocked — either by the remote server or by a firewall/proxy between you and it.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- nc — netcat, arbitrary TCP and UDP connectionsEvidence: nc -vz tests whether a TCP connection can be established and reports success/failure.
Last verified: 2025-11-13 · Category: Network