On Thu, 2023-03-16 at 13:39 +1030, Tim via users wrote:
Traditionally hosts was consulted before other measures (making it useful as an override). The priority of what is consulted to resolve names is set in /etc/nsswitch.com (name server switch config file). Scroll down to you find the hosts line. There's often a hashed-out example, followed by what's actually used. The left-most entry is used first, and it walks across the line until it finds an answer.
Mine's quite bare:
#hosts: db files nisplus nis dns hosts: files dns
I probably should have pointed out that, in this example, the "files" option means to refer to the /etc/hosts file.
Elsewhere in nsswitch.conf, a files options refers to some other file, pertinent to that part of the configuration.