Linux command line utility to resolve host names using /etc/hosts first

This is easily achieved with getent:

getent hosts 127.0.0.1

getent will do lookups for any type of data configured in nsswitch.conf.

Leave a Comment