Handling the case in which hostname is present instead of IP address only.