Which command checks web server port listening?
A systems administrator is investigating why users cannot reach a Linux web server with a browser but can ping the server IP. The server is online, the web server process is running, and the link to the switch is up. Which of the following commands should the administrator run on the server first?
Community Votes
67% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The test focuses on distinguishing between Layer 3 connectivity (ping) and Layer 4 service availability; the trap is immediately using tcpdump instead of first verifying the listening socket.
For a Linux web server that can be pinged but not reached via browser, netstat is the first command to verify the web service is listening on port 80/443. Community consensus favors netstat for checking listening ports and associated processes.
The most common wrong answer is tcpdump, chosen by 33% of voters, because it captures packets but is not the first step when the web server process is already running; netstat quickly confirms whether the server is listening on the expected port.
Community Discussion (6 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
netstat -tulpn shows TCP/UDP listening ports, the process ID, and the process name. Since the web server process is running, the issue may be that it is not bound to the expected port or interface. Running netstat first confirms whether port 80 or 443 is listening before performing any packet capture. Comment [1] and [2] support this by mentioning netstat's ability to check if ports 80 and 443 are active.
Why the Other Options Are Wrong
traceroute checks the network path, but connectivity already works because users can ping the server IP. tcpdump is useful for deep packet inspection but should be used after verifying the listening socket; comment [3] suggests tcpdump but misses the 'first' priority. arp resolves MAC addresses and is irrelevant to service or port issues. Therefore, netstat is the most logical first command in this scenario.
Community Comment Notes
Comment [2] provides detailed netstat flags (tulpn) and explains how to filter for port 80, which is extremely helpful. Comment [1] simply states that netstat checks if ports 80 and 443 are running. Comment [3] and [5] recommend tcpdump, but their reasoning about analyzing incoming packets is premature if the server is not listening on the correct port. The vote distribution (67 for B) strongly supports netstat as the correct answer.
Official Reference
Exam Strategy
Use the OSI model when troubleshooting: first verify Layer 4 listening sockets before capturing packets. Memorize netstat -tulpn to quickly identify which process is listening on which port, and filter for the expected web port (80/443).