"getent hosts" on IPv4/IPv6. Linux vs. Solaris
By Katsumii-Oracle on Dec 21, 2012
"getent hosts (server name)" is typically run when one wants to check whether /etc/nsswitch.conf is correctly set up.
I recently found differences between Linux and Solaris when it tries to find IPv4/IPv6 addresses.
I think these are the commands. The result may differ depending on whether the originating and target server has IPv4/IPv6 configured.
Linux IPv6 when target has IPv6 address assigned. If the target doesn't have IPv6, this shows IPv4.
$ getent hosts ipv6-test.com 2001:41d0:1:d87c::7e57:1 ipv6-test.com
$ getent ahosts ipv6-test.com 18.104.22.168 STREAM ipv6-test.com [...] 2001:41d0:1:d87c::7e57:1 STREAM
Solaris IPv6 when the originating server has IPv6 configured
$ getent ipnodes ipv6-test.com 22.214.171.124 ipv6-test.com 2001:41d0:1:d87c::7e57:1 ipv6-test.com
$ getent hosts ipv6-test.com 126.96.36.199 ipv6-test.com