Test if a host and port are reachable on Mac

Check TCP connectivity to any server, useful for firewall debugging.

macOSDiagnosticsDNSTerminalLow risk
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 443

02What 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

RiskLow risk
CompatibilitymacOS 10.11 El Capitan – 15 Sequoia

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2025-11-13 · Category: Network

06Related solutions