Added better handling around hostnames and IP addresses