In case anyone cares, this how I eventually did it:
let first = hostent.addrList[0]
let a = uint8(first[0])
let b = uint8(first[1])
let c = uint8(first[2])
let d = uint8(first[3])
let ipstr = $a & "." & $b & "." & $c & "." & $d
try:
ip = parseIpAddress(ipstr)
except:
raise newException(Exception, "Bad URL: '" & hostport & "': failed to parse IP of address: " & ipstr)
Rather ugly, but seems to work.