nerdexam
CompTIA

LX0-104 · Question #471

Which of the following lines would you find in the file /etc/hosts?

The correct answer is B. 192.168.168.4 dns-server. The /etc/hosts file maps IP addresses to hostnames for local resolution, allowing systems to resolve hostnames without relying on DNS servers. Entries in this file consist of an IP address followed by one or more hostnames.

Networking Fundamentals

Question

Which of the following lines would you find in the file /etc/hosts?

Options

  • Aorder hosts, bind
  • B192.168.168.4 dns-server
  • Chosts: files,dns
  • Ddomain mycompany.com

How the community answered

(21 responses)
  • A
    10% (2)
  • B
    86% (18)
  • C
    5% (1)

Why each option

The /etc/hosts file maps IP addresses to hostnames for local resolution, allowing systems to resolve hostnames without relying on DNS servers. Entries in this file consist of an IP address followed by one or more hostnames.

Aorder hosts, bind

order hosts, bind is a line found in the /etc/host.conf file, which specifies the order in which name services are queried (e.g., local hosts file then DNS).

B192.168.168.4 dns-serverCorrect

The /etc/hosts file contains static mappings of IP addresses to hostnames. A line like 192.168.168.4 dns-server is a typical entry, mapping the IP address 192.168.168.4 to the hostname dns-server.

Chosts: files,dns

hosts: files,dns is a line typically found in /etc/nsswitch.conf, which defines the lookup order for various system services, including host resolution.

Ddomain mycompany.com

domain mycompany.com is a line found in /etc/resolv.conf, which specifies the default domain name to be appended to hostnames during resolution.

Concept tested: /etc/hosts file content

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

Topics

#/etc/hosts#DNS resolution#IP address#hostname mapping

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice