title: How to know the cause of UnknownHostException?
body: <p>An <code>UnknownHostException</code> is thrown if a server is down or if there is no internet connection. How can I determine if the <code>UnknownHostException</code> is thrown because the server is down or there is no internet connection?</p>
  
  <p>The reason for this is I need to notify the user about the cause of the error. And I have to display something like this "Sorry. The service is currently not available. Please try again later" or "You do not have an internet connection".</p>