Yuppyのコメント: Re:未だに gethostbyname なんか使っているんじゃねぇよ (スコア 1) 34
LinuxのgethostbynameはIPv4オンリーではなくIPv6もOKであるように拡張されてるような。
man gethostbynameより:
The  gethostbyname()  function  returns a structure of type hostent for
the given host name.  Here name  is  either  a  hostname,  or  an  IPv4
address  in  standard  dot  notation  (as for inet_addr(3)), or an IPv6
address in colon (and possibly dot) notation.  (See  RFC 1884  for  the
description of IPv6 addresses.)  If name is an IPv4 or IPv6 address, no
      :