Catch fails of gethostbyname