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.
Question
Options
- Aorder hosts, bind
- B192.168.168.4 dns-server
- Chosts: files,dns
- Ddomain mycompany.com
How the community answered
(22 responses)- A5% (1)
- B91% (20)
- D5% (1)
Why each option
/etc/hosts maps IP addresses to hostnames, locally resolving names without DNS queries.
This line specifies the order of name resolution services, typically found in /etc/nsswitch.conf.
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.
This entry specifies the name service lookup order for hosts, found in /etc/nsswitch.conf, not /etc/hosts.
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
Community Discussion
No community discussion yet for this question.