Convert hostname to IP Address

When calling hubAction from a device code one needs to use IPAddress and ports. this is what I understood from here:

so if the user enters a (public) hostname instead of an ipaddress when initializing the device, how does one convert it to an IPAddress. @urman looping you into the conversation incase you’ve any insight into this and why InetAddress doesn’t work with ST.