nerdexam
CompTIA

XK0-004 · Question #254

A Linux user needs to connect to a remote email server named mail.foo.com through the SMTP port. Which of the following commands will accomplish this task?

The correct answer is B. netcat mail.foo.com 25. Connecting to a remote server on a specific TCP port requires netcat, and SMTP uses port 25 - not traceroute, which traces routing paths rather than establishing TCP connections.

Server Side & Network Concepts

Question

A Linux user needs to connect to a remote email server named mail.foo.com through the SMTP port. Which of the following commands will accomplish this task?

Options

  • Atraceroute mail.foo.com 25
  • Bnetcat mail.foo.com 25
  • Ctraceroute mail.foo.com 110
  • Dnetcat mail.foo.com 110

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    94% (29)
  • C
    3% (1)

Why each option

Connecting to a remote server on a specific TCP port requires netcat, and SMTP uses port 25 - not traceroute, which traces routing paths rather than establishing TCP connections.

Atraceroute mail.foo.com 25

traceroute maps the routing path to a destination; it does not establish a TCP connection to a service port and cannot be used to connect to SMTP.

Bnetcat mail.foo.com 25Correct

netcat (nc) opens a raw TCP connection to a specified host and port, allowing direct communication with a service. SMTP operates on TCP port 25, so 'netcat mail.foo.com 25' establishes a connection to the mail server's SMTP listener, enabling the user to interact with it directly.

Ctraceroute mail.foo.com 110

traceroute does not make TCP connections to application ports, and port 110 is POP3 for receiving mail, not the SMTP submission port.

Dnetcat mail.foo.com 110

netcat on port 110 connects to a POP3 service, not SMTP; SMTP uses port 25, not 110.

Concept tested: Connecting to TCP services with netcat and SMTP port

Source: https://linux.die.net/man/1/nc

Topics

#netcat#SMTP#port 25#network connectivity

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice