Friday Dec 21, 2012

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

"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




About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« December 2012 »
SunMonTueWedThuFriSat
      
1
2
5
6
7
8
9
10
11
12
13
14
15
16
18
19
22
23
24
28
29
30
31
     
Today