Quantcast
Channel: Oracle Bloggers
Viewing all articles
Browse latest Browse all 19780

"getent hosts" on IPv4/IPv6. Linux vs. Solaris

$
0
0

"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

Linux IPv4

$getent ahosts ipv6-test.com
46.105.61.149   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
46.105.61.149   ipv6-test.com
2001:41d0:1:d87c::7e57:1        ipv6-test.com

Solaris IPv4

$getent hosts ipv6-test.com
46.105.61.149   ipv6-test.com





Viewing all articles
Browse latest Browse all 19780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>