Better handling of looking up local IP address