I am in the shell and I want to know the corresponding IP address(es) for a hostname.
I know I could get it through Perl, PHP, Python or a number of other scripting languages (probably even awk!), and this will be my workaround, but I am surprised that there seems to be no command-line tool to do this, no simple wrapper around
Am I wrong? Is there one?
getent do not count, I want something that uses the libc and acts according to
/etc/nsswitch.conf, and something that is probably installed on any (linux) system by default.
Answer: I was wrong,
getent does not exclusively look in
/etc/hosts, it actually does a proper lookup.