nerdexam
Linux_Foundation

LFCS · 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. /etc/hosts maps IP addresses to hostnames, locally resolving names without DNS queries.

Submitted by yuriko_h· Apr 18, 2026Networking

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

(22 responses)
  • A
    5% (1)
  • B
    91% (20)
  • D
    5% (1)

Why each option

/etc/hosts maps IP addresses to hostnames, locally resolving names without DNS queries.

Aorder hosts, bind

This line specifies the order of name resolution services, typically found in /etc/nsswitch.conf.

B192.168.168.4 dns-serverCorrect

The line '192.168.168.4 dns-server' correctly represents an IP address mapped to a hostname, which is the standard format for an entry in the /etc/hosts file to provide local hostname resolution.

Chosts: files,dns

This entry specifies the name service lookup order for hosts, found in /etc/nsswitch.conf, not /etc/hosts.

Ddomain mycompany.com

The 'domain' directive is used in /etc/resolv.conf to specify the local domain name for DNS lookups.

Concept tested: Linux /etc/hosts file format and function

Source: https://learn.microsoft.com/en-us/previous-versions/tn-archive/aa997530(v=technet.10)#etc-hosts

Topics

#etc/hosts#Hostname Resolution#Network Configuration

Community Discussion

No community discussion yet for this question.

Full LFCS Practice