NETWORK-AND-SECURITY-FOUNDATION practice question 4 of 15

A person is troubleshooting a network issue and needs to see a list of all active network connections. Which Linux command should be used?

Full set: 62 questions

Domain Networking

Answer options
A: nslookup
B: netstat Correct answer
C: dig
D: ifconfig
Correct Answer:
B. netstat
Explanation

The netstat (network statistics) command is a command-line utility used to display network connections, routing tables, and various network interface statistics. Its primary function is to show active TCP and UDP connections, listening ports, and the processes using them. Running netstat (often with flags like -a for all sockets, -t for TCP, -u for UDP, -n for numeric addresses) directly provides the list of active connections that the user requires for troubleshooting. While newer tools like ss are often recommended, netstat remains a fundamental and widely available tool for this task.

Why Incorrect

A. nslookup: This is a utility for querying Domain Name System (DNS) servers to resolve hostnames, not for listing active connections.
C. dig: Like nslookup, dig (Domain Information Groper) is a tool for interrogating DNS servers and does not display network connections.
D. ifconfig: This command is used to display or configure a system's network interfaces (e.g., IP address, netmask), not to list active connections. ---

References

1. The Linux man-pages project. netstat(8) — Linux manual page. "netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships." Retrieved from https://man7.org/linux/man-pages/man8/netstat.8.html (Section: NAME).

2. Red Hat Customer Portal. RHEL 7 Networking Guide. "Chapter 33. Displaying Network Sockets with ss and netstat". This official vendor documentation describes netstat as a tool for displaying "information about network connections, routing tables, and network interfaces."

3. Stanford University, CS 144: Introduction to Computer Networking. Lab 0: Networking Warmup. The course materials introduce fundamental networking tools, describing netstat -pant as the command to "list all listening and established TCP sockets with the associated process name." This confirms its use for viewing active connections in an academic context.

Scroll to Top