public static IRubyObject gethostbyname(ThreadContext context, IRubyObject recv, IRubyObject hostname) {
try {
InetAddress addr = getRubyInetAddress(hostname.convertToString().getByteList());
Ruby runtime = context.getRuntime();
IRubyObject[] ret = new IRubyObject[4];
ret[0] = runtime.newString(addr.getCanonicalHostName());
ret[1] = runtime.newArray();
ret[2] = runtime.newFixnum(2); // AF_INET
ret[3] = runtime.newString(new ByteList(addr.getAddress()));
return runtime.newArrayNoCopy(ret);
} catch(UnknownHostException e) {