nerdexam
CompTIA

XK0-004 · Question #443

A systems administrator needs to see if a mail server is listening on port 25. Which of the following is the BEST command for the administrator to run on the mail server to see if the port is…

The correct answer is A. netatat -punta1 I grep 25. This question tests knowledge of the correct command to verify whether a specific port is in a listening state on a Linux server.

Troubleshooting and Diagnostics

Question

A systems administrator needs to see if a mail server is listening on port 25. Which of the following is the BEST command for the administrator to run on the mail server to see if the port is listening for connections?

Options

  • Anetatat -punta1 I grep 25
  • Btelnet lecalhost -P 25
  • Cps aux I grap 25
  • Dnslookup localhost 25

How the community answered

(37 responses)
  • A
    89% (33)
  • B
    5% (2)
  • C
    3% (1)
  • D
    3% (1)

Why each option

This question tests knowledge of the correct command to verify whether a specific port is in a listening state on a Linux server.

Anetatat -punta1 I grep 25Correct

The netstat command with flags such as -tulnp or variants thereof displays all active TCP and UDP sockets along with their listening state and the associated process. Piping the output through 'grep 25' filters the results to show only lines referencing port 25, confirming whether the mail service is actively listening. This is the standard approach for local port-state verification on a Linux host.

Btelnet lecalhost -P 25

The telnet command tests outbound connectivity to a remote host and port but does not inspect the local socket table to confirm a port is in a listening state; it also uses incorrect flag syntax for port specification.

Cps aux I grap 25

'ps aux' lists running processes and their arguments, not open network ports - grepping for '25' would match any process ID or argument containing that number, not reliably identify port 25.

Dnslookup localhost 25

nslookup is a DNS resolution utility used to query name servers and has no capability to inspect TCP/UDP port states on the local or remote host.

Concept tested: netstat command verifying listening port state

Source: https://man7.org/linux/man-pages/man8/netstat.8.html

Topics

#netstat#port monitoring#network diagnostics#SMTP

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice