Skip to main content

Jeff Friesen: Hostname and IP address conversions

Jeff Friesen investigates Java Hostname and IP address conversions:

While developing networking code in Java, you might find yourself
needing to convert a hostname to an IP address and vice versa. The
java.net.InetAddress class provides the means to
accomplish these tasks via its

public static InetAddress
            getByName(String hostname)
,
public String
            getHostAddress()
and
public String
            getHostName()
methods...

Community: General