{
  "id": 17519253,
  "title": "Consider Using the nc Command for Connectivity Verification",
  "url": "https://urgent.news/2026/11/01/consider-using-the-nc-command-for-connectivity-verification",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-01T02:33:17.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kawasaki031677/consider-using-the-nc-command-for-connectivity-verification-23ii"
  },
  "original_language": "en",
  "account": "When trying to establish a connection to external servers or databases, many people turn to the nc (Netcat) command for verification. This utility is particularly useful in this scenario due to its simplicity and effectiveness. To use it, you would enter the following command: `$ nc -zv hostname or IP address port number`. If the connection is successful, the output \"Connection to ... succeeded!\" is displayed.\n\nFor example, if you were trying to connect to google.com on port 80, the command would be `$ nc -zv google.com 80`. Upon successful connection, you would see the message \"Connection to google.com (142.250.207.46) 80 port [tcp/http] succeeded!\" This indicates that the connectivity is functioning correctly.\n\nAlthough one might initially consider using ping for connectivity checks, it's important to note that ping utilizes the ICMP protocol. If the receiving end does not permit ICMP, the test will fail, which can happen due to security groups or firewalls blocking it. Instead of relying solely on ping, it's recommended to verify the ability to access the API or database at the network level using the nc command. This approach ensures that any issues at the underlying network level are identified early on, making troubleshooting more efficient.\n\nWhile curl or psql can be used to test application layer connectivity after confirming network level access, it's still prudent to use the nc command first. This provides a layer-by-layer verification process, helping to pinpoint the source of any connection failures.\n\nTelnet, a traditional method for establishing connections, is often discouraged due to security concerns. For these reasons, the nc command stands out as a practical and underrated tool for connectivity verification. It provides clear indications about open TCP ports and even supports UDP, making it a versatile option. However, keep in mind that nc might not be pre-installed on all systems, such as Amazon Linux. In such cases, you would need to install it using the package manager, for instance, with the command `$ dnf install nmap-ncat`.",
  "summary": "Introduction When verifying connectivity to external servers or databases, which command do you typically use? I'd like to recommend the nc (Netcat) command for this purpose. Why I Recommend the nc Command The nc (Netcat) command is convenient for connectivity verification. Here's how to use it: $ nc -zv < hostname or IP address> <port number> $ nc -zv google.com 80 If you see Connection to ...…",
  "key_points": [
    "Use nc command for connectivity verification",
    "Display \"Connection succeeded!\" on success",
    "Preferred over ping for network-level checks"
  ],
  "editors_take": "Prioritizing Netcat over ping allows engineers to bypass ICMP restrictions and identify network-level failures before wasting time troubleshooting application layer issues with more complex tools.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}