Prevent adding undefined IP address to the hosts list