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.
Question
Options
- Aorder hosts, bind
- B192.168.168.4 dns-server
- Chosts: files,dns
- Ddomain mycompany.com
How the community answered
(21 responses)- A10% (2)
- B86% (18)
- C5% (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.
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).
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.
hosts: files,dns is a line typically found in /etc/nsswitch.conf, which defines the lookup order for various system services, including host resolution.
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
Community Discussion
No community discussion yet for this question.