More robust handling.  Return 500 on malformed or unreachable hosts.