Added check for valid ip address as domain name.