nerdexam
CompTIA

LX0-104 · Question #663

Which of the following files is consulted when programs like netstat try to match port numbers to names?

The correct answer is E. /etc/services. Programs like netstat consult the /etc/services file to map port numbers to their corresponding human-readable service names for display.

Networking Fundamentals

Question

Which of the following files is consulted when programs like netstat try to match port numbers to names?

Options

  • A/etc/networks
  • B/etc/portmapper
  • C/etc/protocols
  • D/etc/resolv.conf
  • E/etc/services

How the community answered

(30 responses)
  • A
    3% (1)
  • D
    7% (2)
  • E
    90% (27)

Why each option

Programs like netstat consult the /etc/services file to map port numbers to their corresponding human-readable service names for display.

A/etc/networks

The /etc/networks file maps network names to network numbers, not port numbers to service names.

B/etc/portmapper

/etc/portmapper is not a standard configuration file for matching port numbers to names; portmapper (rpcbind) is a service that maps RPC program numbers to network port numbers.

C/etc/protocols

The /etc/protocols file maps protocol names (like tcp, udp, icmp) to protocol numbers, not service names to port numbers.

D/etc/resolv.conf

The /etc/resolv.conf file specifies the configuration for DNS resolvers, such as nameserver addresses and search domains, not port-to-service name mappings.

E/etc/servicesCorrect

The /etc/services file is a standard Unix-like system configuration file that contains a list of known service names and their corresponding port numbers and protocols (e.g., http 80/tcp), which netstat uses for displaying service names instead of numeric ports.

Concept tested: /etc/services file purpose

Source: https://www.man7.org/linux/man-pages/man5/services.5.html

Topics

#/etc/services#Port to name mapping#Network utilities

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice