Catch exceptions when there is no hostname to look up