Java tutorial
//package com.java2s; import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static byte[] stringToIPAddress(final String pString) throws UnknownHostException { return InetAddress.getByName(pString).getAddress(); } }