Allow hostnames when looking for IPs in javascript