The keyword files must be listed in the hosts option of the Name Service Switch configuration file in
order to make host lookups consult the /etc/hosts file. The files service specifies that the local files,
such as /etc/hosts, should be used as a source of information. The order of the services on the line
determines the order in which those services will be queried, in turn, until a result is found. For
example, if the hosts option is set to:
hosts: files dns
then the /etc/hosts file will be searched first, and if no match is found, the DNS server will be queried
next. If the hosts option is set to:
hosts: dns files
then the DNS server will be queried first, and if no match is found, the /etc/hosts file will be searched
next. Reference:
LPI 102-500 Exam Objectives,